Merge branch '2.2' into develop

This commit is contained in:
Markus Mäkelä
2018-10-02 10:18:09 +03:00
16 changed files with 125 additions and 135 deletions

View File

@ -24,32 +24,18 @@ MXS_BEGIN_DECLS
/**
* MXS_BACKEND_SO_RCVBUF
* MXS_SO_RCVBUF
*
* The value used when setting SO_RCVBUF of backend sockets.
* The size of the network input buffer.
*/
#define MXS_BACKEND_SO_RCVBUF (128 * 1024)
#define MXS_SO_RCVBUF_SIZE (128 * 1024)
/**
* MXS_BACKEND_SO_SNDBUF
* MXS_SO_SNDBUF
*
* The value used when setting SO_SNDBUF of backend sockets.
* The size of the network output buffer.
*/
#define MXS_BACKEND_SO_SNDBUF (128 * 1024)
/**
* MXS_CLIENT_SO_RCVBUF
*
* The value used when setting SO_RCVBUF of client sockets.
*/
#define MXS_CLIENT_SO_RCVBUF (128 * 1024)
/**
* MXS_CLIENT_SO_SNDBUF
*
* The value used when setting SO_SNDBUF of client sockets.
*/
#define MXS_CLIENT_SO_SNDBUF (128 * 1024)
#define MXS_SO_SNDBUF_SIZE (128 * 1024)
/**
* MXS_MAX_NW_READ_BUFFER_SIZE

View File

@ -46,6 +46,20 @@ enum mxs_socket_type
bool utils_init(); /*< Call this first before using any other function */
void utils_end();
/**
* Configure network socket options
*
* This is a helper function for setting various socket options that are always wanted for all types
* of connections. It sets the socket into nonblocking mode, configures sndbuf and rcvbuf sizes
* and sets TCP_NODELAY (no Nagle algorithm).
*
* @param so Socket to configure
* @param type Socket type
*
* @return True if configuration was successful
*/
bool configure_network_socket(int so, int type);
/**
* @brief Create a network socket and a socket configuration
*