| 201 | } |
| 202 | |
| 203 | DWORD WINAPI hostResolveProc(LPVOID lpParameter) |
| 204 | { |
| 205 | xsSocket xss = (xsSocket)lpParameter; |
| 206 | struct hostent *host; |
| 207 | struct sockaddr_in address = {0}; |
| 208 | |
| 209 | host = gethostbyname(xss->host); |
| 210 | if (NULL != host) { |
| 211 | address.sin_family = AF_INET; |
| 212 | c_memcpy(&(address.sin_addr), host->h_addr, host->h_length); |
| 213 | address.sin_port = htons(xss->port); |
| 214 | connect(xss->skt, (struct sockaddr*)&address, sizeof(address)); |
| 215 | } |
| 216 | |
| 217 | return 0; |
| 218 | } |
| 219 | |
| 220 | int doReadSocket(xsMachine *the, xsSocket xss) |
| 221 | { |