(main) [_WIN32]: Upgrade to winsock version 2.

Remove version 1.1 include files.
This commit is contained in:
Ron Koenderink 2006-02-05 15:47:13 +00:00
parent 59c8e97797
commit 1a539f9128
6 changed files with 5 additions and 10 deletions

View file

@ -56,7 +56,6 @@
#include <unistd.h>
#else
#include <windows.h>
#include <winsock.h>
#include <conio.h>
#include <io.h>
#endif
@ -78,6 +77,7 @@ int
main(int ac, char **av)
{
#ifdef _WIN32
WORD wVersionRequested;
WSADATA WsaData;
int err;
fd_set readfds;
@ -117,9 +117,10 @@ main(int ac, char **av)
* after each prompt is required.
*/
setvbuf(stdout, NULL, _IOLBF, 4096);
err = WSAStartup(0x0101, &WsaData);
if (err == SOCKET_ERROR) {
printf("WSAStartup Failed\n");
wVersionRequested = MAKEWORD(2, 0);
err = WSAStartup(wVersionRequested, &WsaData);
if (err != 0) {
printf("WSAStartup Failed, error code %d\n", err);
return FALSE;
}
#else