2020-01-28 19:24:46 +00:00
|
|
|
def sock_impl_get_options(client, impl_name=None):
|
|
|
|
"""Get parameters for the socket layer implementation.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
impl_name: name of socket implementation, e.g. posix
|
|
|
|
"""
|
|
|
|
params = {}
|
|
|
|
|
|
|
|
params['impl_name'] = impl_name
|
|
|
|
|
|
|
|
return client.call('sock_impl_get_options', params)
|
|
|
|
|
|
|
|
|
2020-07-14 13:28:30 +00:00
|
|
|
def sock_impl_set_options(client,
|
|
|
|
impl_name=None,
|
|
|
|
recv_buf_size=None,
|
|
|
|
send_buf_size=None,
|
2020-07-14 19:03:45 +00:00
|
|
|
enable_recv_pipe=None,
|
2020-07-30 01:59:57 +00:00
|
|
|
enable_zerocopy_send=None,
|
|
|
|
enable_quickack=None):
|
2020-01-28 19:24:46 +00:00
|
|
|
"""Set parameters for the socket layer implementation.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
impl_name: name of socket implementation, e.g. posix
|
|
|
|
recv_buf_size: size of socket receive buffer in bytes (optional)
|
|
|
|
send_buf_size: size of socket send buffer in bytes (optional)
|
2020-07-14 13:28:30 +00:00
|
|
|
enable_recv_pipe: enable or disable receive pipe (optional)
|
2020-07-14 19:03:45 +00:00
|
|
|
enable_zerocopy_send: enable or disable zerocopy on send (optional)
|
2020-07-30 01:59:57 +00:00
|
|
|
enable_quickack: enable or disable quickack (optional)
|
2020-01-28 19:24:46 +00:00
|
|
|
"""
|
|
|
|
params = {}
|
|
|
|
|
|
|
|
params['impl_name'] = impl_name
|
|
|
|
if recv_buf_size is not None:
|
|
|
|
params['recv_buf_size'] = recv_buf_size
|
|
|
|
if send_buf_size is not None:
|
|
|
|
params['send_buf_size'] = send_buf_size
|
2020-07-14 13:28:30 +00:00
|
|
|
if enable_recv_pipe is not None:
|
|
|
|
params['enable_recv_pipe'] = enable_recv_pipe
|
2020-07-14 19:03:45 +00:00
|
|
|
if enable_zerocopy_send is not None:
|
|
|
|
params['enable_zerocopy_send'] = enable_zerocopy_send
|
2020-07-30 01:59:57 +00:00
|
|
|
if enable_quickack is not None:
|
|
|
|
params['enable_quickack'] = enable_quickack
|
2020-01-28 19:24:46 +00:00
|
|
|
|
|
|
|
return client.call('sock_impl_set_options', params)
|