mtcp_setsockopt − set options on mTCP/mOS sockets
#include <mtcp_api.h>
int mtcp_setsockopt(mctx_t mctx, int sockid, int level, int optname, const void *optval, socklen_t optlen);
mtcp_setsockopt() manipulate options for the socket referred to by the sockid descriptor. These options may exist at multiple protocol levels. When manipulating socket options, the level at which the options resides and the name of the option must be specified. A user can use SOL_MONSOCKET level to adjust options for monitoring sockets.
The arguments optval and optlen are used to set options values for mtcp_setsockopt().
SOL_MONSOCKET socket level can be used by mtcp_setsockopt() to set a number of attributes pertaining to the socket.
|
MOS_CLIBUF |
Dynamically adjust the size of the TCP receive ring buffer of the emulated client stack. The optval contains the size of the buffer that needs to be set as int, while optlen is equal to sizeof(int). | ||
|
MOS_SVRBUF |
Dynamically adjust the size of the TCP receive ring buffer of the emulated client stack. The optval contains the size of the buffer that needs to be set as int, while optlen is equal to sizeof(int). |
Returns 0 on success; -1 on failure. In case of failure, errno is set appropriately.
|
EACCES |
mctx is not valid. | ||
|
EBADF |
sockid is not a valid socket descriptor. | ||
|
ENOTSOCK |
The socket referred to by sockid is not valid. | ||
|
ENOSYS |
Either the level or the optname is not implemented. | ||
|
EPERM |
Permission to access a socket option is denied. |
mOS development team <mtcp-user@list.ndsl.kaist.edu>
mtcp_socket(), mtcp_getsockopt()
This page is part of mOS release 0.3 docs section. A description of the project, and information about reporting bugs, can be found at http://mos.kaist.edu/.