Added helper class for receiving data. Modified sender thread to support sending partial packets. Prepared abstractions for server state machine.
This commit is contained in:
@@ -45,13 +45,15 @@ typedef unsigned char u_char;
|
||||
#define SOCKET_ERRNO() errno
|
||||
#define IOCTLSOCKET ioctl
|
||||
#define SOCKET_ERR_WOULDBLOCK EINPROGRESS
|
||||
|
||||
#endif
|
||||
|
||||
#define IS_VALID_SOCKET(_s) ((_s) != INVALID_SOCKET)
|
||||
#define IS_VALID_CONNECT(_c) ((_c) == 0)
|
||||
#define IS_VALID_BIND(_b) ((_b) != SOCKET_ERROR)
|
||||
#define IS_VALID_RECV(_r) ((_r) != SOCKET_ERROR)
|
||||
#define IS_VALID_SEND(_s) ((_s) != SOCKET_ERROR)
|
||||
#define IS_VALID_BIND(_b) ((_b) != SOCKET_ERROR)
|
||||
#define IS_VALID_SELECT(_s) ((_s) != SOCKET_ERROR)
|
||||
|
||||
// All char *s are assumed to be UTF-8.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user