Main Page Class Hierarchy Compound List File List Compound Members File Members

# socket_ew_common.c File Reference

`#include <errno.h>`
`#include <socket_ew.h>`

Go to the source code of this file.

## Functions
timeval FAR * | resetTimeout (struct timeval FAR *)
Time_ew | adjustTimeoutLength (int timeout_msec)
SOCKET | socket_ew (int af, int type, int protocol)
int | connect_ew (SOCKET s, struct sockaddr FAR *name, int namelen, int timeout_msec)
int | bind_ew (SOCKET s, struct sockaddr FAR *name, int namelen)
int | listen_ew (SOCKET s, int backlog)
SOCKET | accept_ew (SOCKET s, struct sockaddr FAR *addr, int FAR *addrlen, int timeout_msec)
int | recv_all (SOCKET s, char FAR *buf, int len, int flags, int timeout_msec)
int | recv_ew (SOCKET s, char FAR *buf, int len, int flags, int timeout_msec)
int | recvfrom_ew (SOCKET s, char FAR *buf, int len, int flags, struct sockaddr FAR *from, int FAR *fromlen, int timeout_msec)
int | send_ew (SOCKET s, const char FAR *buf, int len, int flags, int timeout_msec)
int | sendto_ew (SOCKET s, const char FAR *buf, int len, int flags, const struct sockaddr FAR *to, int tolen, int timeout_msec)
int | closesocket_ew (SOCKET s, int HowToClose)
int | select_ew (int nfds, fd_set FAR *readfds, fd_set FAR *writefds, fd_set FAR *exceptfds, int timeout_msec)
int | setSocket_ewDebug (int debug)
int | setSocket_ewSelectTimeout (unsigned int Timeout)
## Variables
int | SELECT_TIMEOUT_SECONDS = 0
int | SELECT_TIMEOUT_uSECONDS = 200000
int | EW_SOCKET_DEBUG = 0
int | SOCKET_SYS_INIT

## Function Documentation

SOCKET accept_ew | ( | SOCKET | s,
|  | struct sockaddr FAR * | addr,
|  | int FAR * | addrlen,
|  | int | timeout_msec
| ) |

| Definition at line 329 of file socket_ew_common.c. References adjustTimeoutLength(), closesocket_ew(), EW_SOCKET_DEBUG, GetTime_ew(), logit(), resetTimeout(), sleep_ew(), and socketGetError_ew(). Referenced by WormServerBase::Listener().

Time_ew adjustTimeoutLength | ( | int | timeout_msec | ) |

| Definition at line 139 of file socket_ew.c.

int bind_ew | ( | SOCKET | s,
|  | struct sockaddr FAR * | name,
|  | int | namelen
| ) |

| Definition at line 276 of file socket_ew_common.c. References EW_SOCKET_DEBUG, logit(), and socketGetError_ew(). Referenced by WormServerBase::Listener().

int closesocket_ew | ( | SOCKET | s,
|  | int | HowToClose
| ) |

| Definition at line 1050 of file socket_ew_common.c. References logit(), SOCKET_CLOSE_IMMEDIATELY_EW, SOCKET_CLOSE_SIMPLY_EW, and socketGetError_ew(). Referenced by accept_ew(), MutableServerBase::ClientServicer(), connect_ew(), WormServerBase::Listener(), MutableServerBase::TransmitRequest(), wsDetachServer(), and wsKillMenu().

int connect_ew | ( | SOCKET | s,
|  | struct sockaddr FAR * | name,
|  | int | namelen,
|  | int | timeout_msec
| ) |

| Definition at line 113 of file socket_ew_common.c. References closesocket_ew(), EW_SOCKET_DEBUG, logit(), and socketGetError_ew(). Referenced by MutableServerBase::TransmitRequest(), and wsAttachServer().

int listen_ew | ( | SOCKET | s,
|  | int | backlog
| ) |

| Definition at line 302 of file socket_ew_common.c. References EW_SOCKET_DEBUG, logit(), and socketGetError_ew(). Referenced by WormServerBase::Listener().

int recv_all | ( | SOCKET | s,
|  | char FAR * | buf,
|  | int | len,
|  | int | flags,
|  | int | timeout_msec
| ) |

| Definition at line 447 of file socket_ew_common.c. References adjustTimeoutLength(), GetTime_ew(), logit(), resetTimeout(), sleep_ew(), and socketGetError_ew(). Referenced by wsGetTraceBin().

int recv_ew | ( | SOCKET | s,
|  | char FAR * | buf,
|  | int | len,
|  | int | flags,
|  | int | timeout_msec
| ) |

| Definition at line 591 of file socket_ew_common.c. References adjustTimeoutLength(), EW_SOCKET_DEBUG, GetTime_ew(), logit(), resetTimeout(), sleep_ew(), and socketGetError_ew(). Referenced by WormServerBase::ListenForMsg().

int recvfrom_ew | ( | SOCKET | s,
|  | char FAR * | buf,
|  | int | len,
|  | int | flags,
|  | struct sockaddr FAR * | from,
|  | int FAR * | fromlen,
|  | int | timeout_msec
| ) |

| Definition at line 697 of file socket_ew_common.c. References adjustTimeoutLength(), EW_SOCKET_DEBUG, GetTime_ew(), logit(), resetTimeout(), sleep_ew(), and socketGetError_ew().

struct timeval FAR * resetTimeout | ( | struct timeval FAR * |  | ) |

| Definition at line 1026 of file socket_ew_common.c. References logit(), resetTimeout(), SELECT_TIMEOUT_SECONDS, and SELECT_TIMEOUT_uSECONDS. Referenced by resetTimeout(), wsWaitAscii(), and wsWaitBinHeader().

int select_ew | ( | int | nfds,
|  | fd_set FAR * | readfds,
|  | fd_set FAR * | writefds,
|  | fd_set FAR * | exceptfds,
|  | int | timeout_msec
| ) |

| Definition at line 1110 of file socket_ew_common.c. References EW_SOCKET_DEBUG, logit(), and socketGetError_ew().

int send_ew | ( | SOCKET | s,
|  | const char FAR * | buf,
|  | int | len,
|  | int | flags,
|  | int | timeout_msec
| ) |

| Definition at line 793 of file socket_ew_common.c. References adjustTimeoutLength(), GetTime_ew(), logit(), min, resetTimeout(), sleep_ew(), and socketGetError_ew(). Referenced by WormServerBase::SendMessage(), wsAppendMenu(), wsGetTraceAscii(), and wsGetTraceBin().

int sendto_ew | ( | SOCKET | s,
|  | const char FAR * | buf,
|  | int | len,
|  | int | flags,
|  | const struct sockaddr FAR * | to,
|  | int | tolen,
|  | int | timeout_msec
| ) |

| Definition at line 928 of file socket_ew_common.c. References adjustTimeoutLength(), EW_SOCKET_DEBUG, GetTime_ew(), logit(), resetTimeout(), sleep_ew(), and socketGetError_ew().

int setSocket_ewDebug | ( | int | debug | ) |

| Definition at line 1145 of file socket_ew_common.c. References EW_SOCKET_DEBUG. Referenced by MutableServerBase::MainThreadActions(), and WormServerBase::Run().

int setSocket_ewSelectTimeout | ( | unsigned int | Timeout | ) |

| Definition at line 1156 of file socket_ew_common.c. References SELECT_TIMEOUT_uSECONDS.

SOCKET socket_ew | ( | int | af,
|  | int | type,
|  | int | protocol
| ) |

| Definition at line 65 of file socket_ew_common.c. References EW_SOCKET_DEBUG, logit(), SOCKET_SYS_INIT, socketGetError_ew(), and SocketSysInit(). Referenced by WormServerBase::Listener(), MutableServerBase::TransmitRequest(), and wsAttachServer().

## Variable Documentation

int EW_SOCKET_DEBUG = 0

| Definition at line 47 of file socket_ew_common.c. Referenced by accept_ew(), bind_ew(), connect_ew(), listen_ew(), recv_ew(), recvfrom_ew(), select_ew(), sendto_ew(), setSocket_ewDebug(), and socket_ew().

int SELECT_TIMEOUT_SECONDS = 0

| Definition at line 44 of file socket_ew_common.c. Referenced by resetTimeout().

int SELECT_TIMEOUT_uSECONDS = 200000

| Definition at line 45 of file socket_ew_common.c. Referenced by resetTimeout(), and setSocket_ewSelectTimeout().

int SOCKET_SYS_INIT

| Definition at line 49 of file socket_ew_common.c. Referenced by socket_ew(), and SocketSysInit().