/* send data */

send(sock, "EPSON\n", 6, 0);

/* gracefully close */ shutdown(sock, 1);/* SD_SEND */ while (1) {

char buf[64];

int n = recv(sock, buf, 64, 0);

if (n = SOCKET_ERROR n == 0) break;

}

shutdown(sock, 2);/* SD_BOTH */

/* close socket */ closesocket(sock); return 0;

}

4-4Programming Samples

Rev. A

Page 62
Image 62
Epson E02 manual 4Programming Samples