17 static tchar WinSockDllName[] =
_T(
"WSock32.dll");
25 TModule(WinSockDllName, true, true, false)
35 static TModuleProc3<SOCKET,SOCKET,struct sockaddr *, int *>
37 return accept(s, addr, addrLen);
43 static TModuleProc3<int,SOCKET,struct sockaddr *,int>
45 return bind(s, addr, nameLen);
58 static TModuleProc3<int,SOCKET,struct sockaddr *,int>
60 return connect(s, name, nameLen);
66 static TModuleProc3<int,SOCKET,struct sockaddr *,int *>
74 static TModuleProc3<int,SOCKET,struct sockaddr *,int *>
82 static TModuleProc5<int,SOCKET,int,int,char *,int *>
84 return getsockopt(s, level, optName, optVal, optLen);
118 static TModuleProc3<int,SOCKET,long,ulong *>
127 return listen(s, backlog);
148 return recv(s, buf, len, flags);
153 struct sockaddr * from,
int* fromLen)
155 static TModuleProc6<int,SOCKET,char *,int,int,struct sockaddr *,int*>
157 return recvfrom(s, buf, len, flags, from, fromLen);
162 struct fd_set * writefds,
struct fd_set * exceptfds,
163 const struct timeval * timeout)
165 static TModuleProc5<int,int,
struct fd_set *,
struct fd_set *,
167 return select(nfds, readfds, writefds, exceptfds, timeout);
174 return send(s, buf, len, flags);
179 const struct sockaddr * to,
int toLen)
181 static TModuleProc6<int,SOCKET,LPCSTR,int,int,
183 return sendto(s, buf, len, flags, to, toLen);
188 LPCSTR optVal,
int optLen)
190 static TModuleProc5<int,SOCKET,int,int,LPCSTR,int>
192 return setsockopt(s, level, optName, optVal, optLen);
206 return socket(af, type, protocol);
216 static TModuleProc3<struct hostent *,LPCSTR,int,int>
224 static TModuleProc1<struct hostent *,LPCSTR>
239 static TModuleProc2<struct servent *,LPCSTR, LPCSTR>
247 static TModuleProc2<struct servent *,int,LPCSTR>
255 static TModuleProc1<struct protoent *, LPCSTR>
263 static TModuleProc1<struct protoent *, int>
317 static TModuleProc1<FARPROC,FARPROC>
331 LPCSTR proto,
char * buf,
int bufLen)
333 static TModuleProc6<HANDLE,HWND,
uint,LPCSTR,LPCSTR,
340 LPCSTR proto,
char * buf,
int bufLen)
342 static TModuleProc6<HANDLE,HWND,uint,int,LPCSTR,char *,int>
349 char * buf,
int bufLen)
351 static TModuleProc5<HANDLE,HWND,uint,LPCSTR,char *,int>
358 char * buf,
int bufLen)
360 static TModuleProc5<HANDLE,HWND,uint,int,char *,int>
367 char * buf,
int bufLen)
369 static TModuleProc5<HANDLE,HWND,uint,LPCSTR,char *,int>
376 int len,
int type,
char * buf,
int bufLen)
378 static TModuleProc7<HANDLE,HWND,uint,LPCSTR,int,int,char *,int>
386 static TModuleProc1<int,HANDLE>
394 static TModuleProc4<int,SOCKET,HWND,uint,long>
409 static TModule winSockModule(WinSockDllName,
true,
true);
410 return winSockModule;
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
The TWinSockDll class encapsulates the WinSock DLL (WINSOCK.DLL).
static int getpeername(SOCKET s, struct sockaddr *name, int *nameLen)
static struct hostent * gethostbyname(LPCSTR name)
static ulong inet_addr(const char *cp)
static int getsockname(SOCKET s, struct sockaddr *name, int *nameLen)
static int select(int nfds, struct fd_set *readfds, struct fd_set *writefds, struct fd_set *exceptfds, const struct timeval *timeout)
static BOOL WSAIsBlocking(void)
static HANDLE WSAAsyncGetServByPort(HWND hWnd, uint msg, int port, LPCSTR proto, char *buf, int bufLen)
static struct servent * getservbyname(LPCSTR name, LPCSTR proto)
static struct protoent * getprotobyname(LPCSTR name)
static FARPROC WSASetBlockingHook(FARPROC blockFunc)
static int ioctlsocket(SOCKET s, long cmd, ulong *argp)
static int setsockopt(SOCKET s, int level, int optName, LPCSTR optVal, int optLen)
static ushort _ntohs(ushort netShort)
static ulong _ntohl(ulong netLong)
static HANDLE WSAAsyncGetHostByAddr(HWND hWnd, uint msg, LPCSTR addr, int len, int type, char *buf, int bufLen)
static int gethostname(char *name, int nameLen)
static HANDLE WSAAsyncGetHostByName(HWND hWnd, uint msg, LPCSTR name, char *buf, int bufLen)
static struct hostent * gethostbyaddr(LPCSTR addr, int len, int type)
static int shutdown(SOCKET s, int how)
static int WSAUnhookBlockingHook(void)
static SOCKET socket(int af, int type, int protocol)
static int sendto(SOCKET s, LPCSTR buf, int len, int flags, const struct sockaddr *to, int toLen)
static int listen(SOCKET s, int backlog)
static int WSACancelBlockingCall(void)
static int WSAGetLastError(void)
static int WSACancelAsyncRequest(HANDLE hTaskHandle)
static struct servent * getservbyport(int port, LPCSTR proto)
static int WSAStartup(uint16 versionRequested, LPWSADATA WSAData)
static SOCKET accept(SOCKET s, struct sockaddr *addr, int *addrLen)
static int WSACleanup(void)
static HANDLE WSAAsyncGetProtoByName(HWND hWnd, uint msg, LPCSTR name, char *buf, int bufLen)
static ushort _htons(ushort hostShort)
static struct protoent * getprotobynumber(int proto)
static int closesocket(SOCKET s)
static int bind(SOCKET s, struct sockaddr *addr, int nameLen)
static int connect(SOCKET s, struct sockaddr *name, int nameLen)
static char * inet_ntoa(struct in_addr in)
static int getsockopt(SOCKET s, int level, int optName, char *optVal, int *optLen)
static HANDLE WSAAsyncGetServByName(HWND hWnd, uint msg, LPCSTR name, LPCSTR proto, char *buf, int bufLen)
static int send(SOCKET s, LPCSTR buf, int len, int flags)
static void WSASetLastError(int error)
static ulong _htonl(ulong hostLong)
static int WSARecvEx(SOCKET s, char *buf, int len, int *flags)
static HANDLE WSAAsyncGetProtoByNumber(HWND hWnd, uint msg, int number, char *buf, int bufLen)
static TModule & WinSockModule()
static int recvfrom(SOCKET s, char *buf, int len, int flags, struct sockaddr *from, int *fromLen)
static int recv(SOCKET s, char *buf, int len, int flags)
static int WSAAsyncSelect(SOCKET s, HWND hWnd, uint msg, long event)
static bool IsAvailable()
static bool IsAvailable(void)
Returns true if the DLL implementing WinSock is available and loaded, or false otherwise.
static TWinSockDll * Dll(void)
TModule(const tstring &name, bool shouldLoad=true, bool mustLoad=true, bool addToList=true)
Constructs a TModule object that is used as an alias for a DLL.
bool IsLoaded() const
Returns a nonzero value if the instance handle is loaded.
Definition of class TModule.
Object Windows Library (OWLNext Core).
General definitions used by all ObjectWindows programs.
Main header of the Winsock OWL subsystem.