31 WORD wVersionRequested;
34 int sd, newSd, cliLen;
43 printf(
"Could not initialize winsock dll.\n");
50 perror(
"cannot open socket ");
61 perror(
"cannot bind port ");
71 "To start test, Please telnet to localhost (127.0.0.1) port 23 \n"
72 "When connected input raw data followed by End of Line\n"
75 cliLen =
sizeof(cliAddr);
78 perror(
"cannot accept connection ");
89 printf(
"%s: received from %s:TCP%d : %s\n",
argv[0],
116 static int rcv_ptr=0;
129 perror(
" cannot receive data ");
132 printf(
" connection closed by client\n");
144 while(*(rcv_msg+rcv_ptr)!=
END_LINE && rcv_ptr<
n) {
CHAR FAR *WSAAPI inet_ntoa(IN IN_ADDR in)
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
#define memcpy(s1, s2, n)
INT WSAAPI listen(IN SOCKET s, IN INT backlog)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
int PASCAL FAR WSACleanup(void)