00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "SurcoucheReseau.h"
00012
00013 int SocketLoad(void)
00014 {
00015 #ifdef WIN32
00016 WORD wVersionRequested = MAKEWORD(1, 1);
00017 WSADATA wsaData;
00018
00019 if(WSAStartup(wVersionRequested, &wsaData))
00020 {
00021 WSACleanup();
00022 return 1;
00023 }
00024 #else
00025 signal(SIGPIPE, SIG_IGN);
00026 #endif
00027
00028 return 0;
00029 }
00030
00031 void SocketUnLoad(void)
00032 {
00033 #ifdef WIN32
00034 WSACleanup();
00035 #endif
00036 }
00037
00038 void SocketClose(SOCKET Sock)
00039 {
00040 #ifdef WIN32
00041 closesocket(Sock);
00042 #else
00043 close(Sock);
00044 #endif
00045 Sock = 0;
00046 }