|
kType
= SOCK_DGRAM;
}
memset(&local, '\0', sizeof (local));
local.sin_family = PF_INET;
local.sin_port = htons((u_short)iSockPort);
/* allocate a socket descriptor */
hSock = socket(PF_INET, iSockType, 0);
if (hSock == INVALID_SOCKET) { /* socket() failed */
wshout_err
(hOurDlg, WSAGetLastError(), "socket()");
return
(SOCKET) -1;
}
/* bind socket to a local addr */
ret = bind(hSock, (struct sockaddr FAR *) &local, sizeof(local));
if (ret == SOCKET_ERROR){ /* bind() failed */
& |