The socket parameters used by eXtremeDB network communications are defined by the following structure defined in header file
mconet.h
:typedef struct mco_sock_params_t_ { int mode; /* bit set of MCO_SOCK_OPEN_MODE */ int linger; int sndbuf; /* size of socket send buffer in bytes */ int rcvbuf; /* size of socket receive buffer in bytes */int compression_level; /* level of compression */ MCO_SOCK_DOMAIN domain; /* socket domain (may be flag in open_mode ?) */ MCO_SOCK_TYPE type; /* TCP / UDP )may be flag in open_mode ? */ const char *mcast_addr; /* used only if type == MCO_SOCK_MCAST */ void *ssl_params; /* used for SSL sockets when OpenSSL is supported */ MCO_RET last_error; /* OUT : eXtremeDB's error code if mco_create_socket() has failed */ int last_errno; /* OUT : value of errno if mco_create_socket() has failed */ } mco_sock_params_t;The
mode
element is a bitmask that can be set with a combination of the following values:typedef enum MCO_SOCK_OPEN_MODE_E_ { MCO_SOCK_NODELAY = 1, MCO_SOCK_DO_NOT_REUSE_ADDRESS = 2, MCO_SOCK_NON_BLOCKING = 4, MCO_SOCK_KEEP_ALIVE = 8, MCO_SOCK_DO_NOT_CLOEXEC = 16 } MCO_SOCK_OPEN_MODE;The
domain
element must be one of the following:typedef enum MCO_SOCK_DOMAIN_E_ { MCO_SOCK_INET_DOMAIN, /* IPv4 or IPv6 */ MCO_SOCK_INETV4_DOMAIN, /* IPv4 only */ MCO_SOCK_INETV6_DOMAIN, /* IPv6 only */ MCO_SOCK_LOCAL_DOMAIN, MCO_SOCK_SDP_DOMAIN } MCO_SOCK_DOMAIN;The
type
element must be one of the following:typedef enum MCO_SOCK_TYPE_E_ { MCO_SOCK_STREAM, MCO_SOCK_DGRAM, MCO_SOCK_MCAST, } MCO_SOCK_TYPE;