socket_mux Package

socket_mux Package

base Module

class sts.util.socket_mux.base.MockSocket(protocol, sock_type, sock_id=-1, json_worker=None)[source]

Bases: object

__init__(protocol, sock_type, sock_id=-1, json_worker=None)[source]
append_read(data)[source]
close()[source]
fileno()[source]
getpeername()[source]
ready_to_read()[source]
recv(bufsize)[source]
send(data)[source]
setblocking(_)[source]
setsockopt(*args, **kwargs)[source]
class sts.util.socket_mux.base.MultiplexedSelect(*args, **kwargs)[source]

Bases: sts.util.io_master.IOMaster

__init__(*args, **kwargs)[source]
fileno2ready_to_read = {}
handle_socks_rwe(rl, wl, xl, mock_read_socks, mock_write_workers)[source]
ready_to_read(sock_or_io_worker)[source]
select(rl, wl, xl, timeout=0)[source]

Note that this layer is below IOMaster’s Select loop

set_true_io_worker(true_io_worker)[source]
class sts.util.socket_mux.base.SocketDemultiplexer(true_io_worker)[source]

Bases: object

__init__(true_io_worker)[source]
sts.util.socket_mux.base.is_mocked(sock_or_io_worker)[source]
sts.util.socket_mux.base.sort_sockets(rl, wl, xl)[source]

pox_monkeypatcher Module

sts.util.socket_mux.pox_monkeypatcher.launch()[source]

server_socket_multiplexer Module

class sts.util.socket_mux.server_socket_multiplexer.ServerMockSocket(protocol, sock_type, sock_id=-1, json_worker=None, set_true_listen_socket=<function <lambda> at 0x6dd5c08>, peer_address=None)[source]

Bases: sts.util.socket_mux.base.MockSocket

__init__(protocol, sock_type, sock_id=-1, json_worker=None, set_true_listen_socket=<function <lambda> at 0x6dd5c08>, peer_address=None)[source]
accept()[source]
append_new_mock_socket(mock_sock)[source]
bind(server_info)[source]
listen(_)[source]
ready_to_read()[source]
class sts.util.socket_mux.server_socket_multiplexer.ServerMultiplexedSelect(*args, **kwargs)[source]

Bases: sts.util.socket_mux.base.MultiplexedSelect

__init__(*args, **kwargs)[source]
grab_workers_rwe()[source]
handle_socks_rwe(rl, wl, xl, mock_read_socks, mock_write_workers)[source]
ready_to_read(sock_or_io_worker)[source]
set_true_listen_socket(true_listen_socket, mock_listen_sock, accept_callback)[source]
class sts.util.socket_mux.server_socket_multiplexer.ServerSocketDemultiplexer(true_io_worker, mock_listen_sock)[source]

Bases: sts.util.socket_mux.base.SocketDemultiplexer

__init__(true_io_worker, mock_listen_sock)[source]

Whenever we see a handshake from the client, hand new MockSockets to mock_listen_sock so that they can be accept()’ed

new_socket(sock_id=-1, peer_address=None)[source]

sts_socket_multiplexer Module

class sts.util.socket_mux.sts_socket_multiplexer.STSMockSocket(protocol, sock_type, sock_id=-1, json_worker=None)[source]

Bases: sts.util.socket_mux.base.MockSocket

address2demuxer = {}
connect(address)[source]
getpeername()[source]
class sts.util.socket_mux.sts_socket_multiplexer.STSSocketDemultiplexer(true_io_worker, server_info)[source]

Bases: sts.util.socket_mux.base.SocketDemultiplexer

__init__(true_io_worker, server_info)[source]
add_new_socket(new_socket)[source]

Table Of Contents

Previous topic

util Package

Next topic

tests Package

This Page