|
sp; return
(SOCKET) -1; /* Unknown
protocol */
}
/* default port to connect to. Must be in network byte order */
dest.sin_port = htons((u_int) iSockPort);
SetDlgItemText(hOurDlg, IDD_COMMENT,"Resolving hostname...");
/* Resolve the host name */
host_ptr = gethostbyname(lpHostName);
if (host_ptr == NULL) {
wshout_err
(hOurDlg, WSAGetLastError(), "gethostbyname()");
return
(SOCKET) -1;
}
/* Patch host address into struct describing conn: */
bcopy(host_ptr->h_addr,&dest.sin_addr,host_ptr->h_length);
& |