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

# socket_ew.h File Reference

`#include <earthworm.h>`

Go to the source code of this file.

## Defines
#define | SOCKET_CLOSE_IMMEDIATELY_EW 0
#define | SOCKET_CLOSE_GRACEFULLY_EW -1
#define | SOCKET_CLOSE_SIMPLY_EW -2
#define | min(a, b) (((a) < (b)) ? (a) : (b))
#define | MAXSENDSIZE_EW 8192
## Functions
int | socketGetError_ew ()
SOCKET | accept_ew (SOCKET s, struct sockaddr FAR *addr, int FAR *addrlen, int timeout)
int | bind_ew (SOCKET s, struct sockaddr FAR *name, int namelen)
int | closesocket_ew (SOCKET s, int HowToClose)
int | connect_ew (SOCKET s, struct sockaddr FAR *name, int namelen, int timeout)
int | listen_ew (SOCKET s, int backlog)
int | recv_ew (SOCKET s, char FAR *buf, int len, int flags, int timeout)
int | recv_all (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)
int | select_ew (int nfds, fd_set FAR *readfds, fd_set FAR *writefds, fd_set FAR *exceptfds, int timeout)
int | send_ew (SOCKET s, const char FAR *buf, int len, int flags, int timeout)
int | sendto_ew (SOCKET s, const char FAR *buf, int len, int flags, const struct sockaddr FAR *to, int tolen, int timeout)
SOCKET | socket_ew (int af, int type, int protocol)
void | SocketSysInit (void)
int | setSocket_ewSelectTimeout (unsigned int Timeout)
int | setSocket_ewDebug (int debug)
Time_ew | GetTime_ew ()
## Variables
int | SELECT_TIMEOUT_SECONDS
int | SELECT_TIMEOUT_uSECONDS
int | EW_SOCKET_DEBUG

## Define Documentation

#define MAXSENDSIZE_EW 8192

| Definition at line 68 of file socket_ew.h.

#define min | ( | a,
|  | b |  | ) | (((a) < (b)) ? (a) : (b))

| Definition at line 65 of file socket_ew.h. Referenced by datime(), gregor(), grg(), maxamp(), read_hyp(), send_ew(), and SUDSPA_next().

#define SOCKET_CLOSE_GRACEFULLY_EW -1

| Definition at line 29 of file socket_ew.h.

#define SOCKET_CLOSE_IMMEDIATELY_EW 0

| Definition at line 28 of file socket_ew.h. Referenced by closesocket_ew().

#define SOCKET_CLOSE_SIMPLY_EW -2

| Definition at line 30 of file socket_ew.h. Referenced by closesocket_ew().

## Function Documentation

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

| 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().

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
| ) |

| 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().

Time_ew GetTime_ew | ( |  | ) |

| Definition at line 122 of file socket_ew.c. Referenced by accept_ew(), recv_all(), recv_ew(), recvfrom_ew(), send_ew(), sendto_ew(), wsWaitAscii(), and wsWaitBinHeader().

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
| ) |

| 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
| ) |

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

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

| 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
| ) |

| 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
| ) |

| 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().

int socketGetError_ew | ( |  | ) |

| Definition at line 115 of file socket_ew.c. Referenced by accept_ew(), bind_ew(), closesocket_ew(), connect_ew(), listen_ew(), WormServerBase::Listener(), recv_all(), recv_ew(), recvfrom_ew(), select_ew(), send_ew(), WormServerBase::SendMessage(), sendto_ew(), socket_ew(), SocketPerror(), wsWaitAscii(), and wsWaitBinHeader().

void SocketSysInit | ( | void |  | ) |

| Definition at line 37 of file socket_ew.c. References logit(), and SOCKET_SYS_INIT. Referenced by socket_ew(), and WormServerBase::WormServerBase().

## Variable Documentation

int EW_SOCKET_DEBUG

| Definition at line 76 of file socket_ew.h. 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

| Definition at line 74 of file socket_ew.h. Referenced by resetTimeout().

int SELECT_TIMEOUT_uSECONDS

| Definition at line 75 of file socket_ew.h. Referenced by resetTimeout(), and setSocket_ewSelectTimeout().