18 #if !defined(SOCKET_H) 22 #include <sys/types.h> 24 #if defined(_WIN32) || defined(_WIN64) 28 #define MAXHOSTNAMELEN 256 29 #if !defined(SSLSOCKET_H) 31 #define EAGAIN WSAEWOULDBLOCK 33 #define EINTR WSAEINTR 35 #define EINPROGRESS WSAEINPROGRESS 37 #define EWOULDBLOCK WSAEWOULDBLOCK 39 #define ENOTCONN WSAENOTCONN 41 #define ECONNRESET WSAECONNRESET 43 #define ETIMEDOUT WAIT_TIMEOUT 45 #define ioctl ioctlsocket 48 #define INVALID_SOCKET SOCKET_ERROR 49 #include <sys/socket.h> 50 #if !defined(_WRS_KERNEL) 51 #include <sys/param.h> 53 #include <sys/select.h> 56 #include <selectLib.h> 58 #include <netinet/in.h> 59 #include <netinet/tcp.h> 60 #include <arpa/inet.h> 73 #define TCPSOCKET_COMPLETE 0 74 #if !defined(SOCKET_ERROR) 76 #define SOCKET_ERROR -1 79 #define TCPSOCKET_INTERRUPTED -22 82 #if !defined(INET6_ADDRSTRLEN) 83 #define INET6_ADDRSTRLEN 46 88 #define max(A,B) ( (A) > (B) ? (A):(B)) 129 #if defined(__GNUC__) && defined(__linux__) 131 int Socket_new(
const char* addr,
size_t addr_len,
int port,
int*
socket,
long timeout);
void Socket_addPendingWrite(int socket)
void Socket_setWriteCompleteCallback(Socket_writeComplete *)
int Socket_getch(int socket, char *c)
void Socket_outTerminate(void)
void Socket_clearPendingWrite(int socket)
int Socket_putdatas(int socket, char *buf0, size_t buf0len, PacketBuffers bufs)
void Socket_writeComplete(int socket, int rc)
void Socket_close(int socket)
int Socket_new(const char *addr, size_t addr_len, int port, int *socket)
ListElement * cur_clientsds
int Socket_noPendingWrites(int socket)
char * Socket_getdata(int socket, size_t bytes, size_t *actual_len, int *rc)
int Socket_getReadySocket(int more_work, struct timeval *tp, mutex_type mutex)
void Socket_outInitialize(void)
char * Socket_getpeer(int sock)