1 #ifndef GENLIB_NET_SOCK_H 2 #define GENLIB_NET_SOCK_H 49 #define SD_RECEIVE 0x00 60 struct sockaddr_storage foreign_sockaddr;
114 struct sockaddr *foreign_sockaddr);
int sock_read(SOCKINFO *info, char *buffer, size_t bufsize, int *timeoutSecs)
Reads data on socket in sockinfo.
Definition: sock.c:213
int sock_make_blocking(SOCKET sock)
Make socket blocking.
Definition: sock.c:224
int sock_init(SOCKINFO *info, SOCKET sockfd)
Assign the passed in socket descriptor to socket descriptor in the SOCKINFO structure.
Definition: sock.c:64
int sock_destroy(SOCKINFO *info, int ShutdownMethod)
Shutsdown the socket using the ShutdownMethod to indicate whether sends and receives on the socket wi...
Definition: sock.c:90
#define INVALID_SOCKET
Definition: UpnpInet.h:56
#define UpnpCloseSocket
Definition: UpnpInet.h:62
Provides a platform independent way to include TCP/IP types and functions.
int sock_init_with_ip(SOCKINFO *info, SOCKET sockfd, struct sockaddr *foreign_sockaddr)
Calls the sock_init function and assigns the passed in IP address and port to the IP address and port...
Definition: sock.c:74
int SOCKET
Definition: UpnpInet.h:53
int sock_make_no_blocking(SOCKET sock)
Make socket non-blocking.
Definition: sock.c:241
SOCKET socket
Definition: sock.h:58
static UPNP_INLINE int sock_close(SOCKET sock)
Closes the socket if it is different from -1.
Definition: sock.h:72
int sock_write(SOCKINFO *info, const char *buffer, size_t bufsize, int *timeoutSecs)
Writes data on the socket in sockinfo.
Definition: sock.c:218
#define UPNP_INLINE
Declares an inline function.
Definition: UpnpGlobal.h:93
Defines constants that for some reason are not defined on some systems.