Tested all the send/recv flags and the SOL_SOCKET options

This commit is contained in:
Michael Theall 2016-01-20 18:10:48 -06:00
parent 88c1798c12
commit a7a7231085

View File

@ -16,41 +16,31 @@
#define SOCK_STREAM 1
#define SOCK_DGRAM 2
#define MSG_CTRUNC 0x01000000
#define MSG_DONTROUTE 0x02000000
#define MSG_EOR 0x04000000
#define MSG_OOB 0x08000000
#define MSG_PEEK 0x10000000
#define MSG_TRUNC 0x20000000
#define MSG_WAITALL 0x40000000
// any flags > 0x4 causes send/recv to return EOPNOTSUPP
#define MSG_OOB 0x0001
#define MSG_PEEK 0x0002
#define MSG_DONTWAIT 0x0004
#define MSG_DONTROUTE 0x0000 // ???
#define MSG_WAITALL 0x0000 // ???
#define MSG_MORE 0x0000 // ???
#define MSG_NOSIGNAL 0x0000 // there are no signals
#define SHUT_RD 0
#define SHUT_WR 1
#define SHUT_RDWR 2
//#define SO_DEBUG 0x0001 // not working
//#define SO_ACCEPTCONN 0x0002 // not working
#define SO_REUSEADDR 0x0004
//#define SO_KEEPALIVE 0x0008 // not working
//#define SO_DONTROUTE 0x0010 // not working
//#define SO_BROADCAST 0x0020 // not working
#define SO_USELOOPBACK 0x0040
#define SO_LINGER 0x0080
#define SO_OOBINLINE 0x0100
//#define SO_REUSEPORT 0x0200 // not working
/*
* Additional options, not kept in so_options.
* SOL_SOCKET options
*/
#define SO_SNDBUF 0x1001 /* send buffer size */
#define SO_RCVBUF 0x1002 /* receive buffer size */
#define SO_SNDLOWAT 0x1003 /* send low-water mark */
#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
//#define SO_SNDTIMEO 0x1005 /* send timeout */ // not working
//#define SO_RCVTIMEO 0x1006 /* receive timeout */ // not working
#define SO_TYPE 0x1008 /* get socket type */
#define SO_ERROR 0x1009 /* get error status and clear */
#define SO_REUSEADDR 0x0004 // reuse address
#define SO_LINGER 0x0080 // linger (no effect?)
#define SO_OOBINLINE 0x0100 // out-of-band data inline (no effect?)
#define SO_SNDBUF 0x1001 // send buffer size
#define SO_RCVBUF 0x1002 // receive buffer size
#define SO_SNDLOWAT 0x1003 // send low-water mark (no effect?)
#define SO_RCVLOWAT 0x1004 // receive low-water mark
#define SO_TYPE 0x1008 // get socket type
#define SO_ERROR 0x1009 // get socket error
typedef uint32_t socklen_t;
typedef uint16_t sa_family_t;