Implements UDP chaos-proxy logic such as demuxing incoming datagrams from different clients.
Separate connections to server are made for each new client.
Public Member Functions | |
__init__ (self, GateRoute route, EvLoop loop) | |
bool | is_connected (self) |
Returns True if there is active pair of sockets ready to transfer data at the moment. | |
None | to_server_concat_packets (self, int packet_size) |
Pass data in bigger parts. | |
None | to_client_concat_packets (self, int packet_size) |
Pass data in bigger parts. | |
None | to_server_smaller_parts (self, int max_size, *float sleep_per_packet=0) |
Pass data to server in smaller parts. | |
None | to_client_smaller_parts (self, int max_size, *float sleep_per_packet=0) |
Pass data to client in smaller parts. | |
Protected Member Functions | |
typing.List[Socket] | _create_accepting_sockets (self) |
_connect_to_server (self) | |
None | _collect_garbage (self) |
_do_accept (self, Socket accept_sock) | |
This task should wait for connections and create SocketPair. | |
Protected Attributes | |
_sockets | |
_clients | |
_loop | |
_to_server_intercept | |
_to_client_intercept | |
pytest_userver.chaos.UdpGate.__init__ | ( | self, | |
GateRoute | route, | ||
EvLoop | loop ) |
Reimplemented from pytest_userver.chaos.BaseGate.
|
protected |
Reimplemented from pytest_userver.chaos.BaseGate.
|
protected |
|
protected |
Reimplemented from pytest_userver.chaos.BaseGate.
|
protected |
This task should wait for connections and create SocketPair.
Reimplemented from pytest_userver.chaos.BaseGate.
bool pytest_userver.chaos.UdpGate.is_connected | ( | self | ) |
None pytest_userver.chaos.UdpGate.to_client_concat_packets | ( | self, | |
int | packet_size ) |
Pass data in bigger parts.
packet_size | minimal size of the resulting packet |
Reimplemented from pytest_userver.chaos.BaseGate.
None pytest_userver.chaos.UdpGate.to_client_smaller_parts | ( | self, | |
int | max_size, | ||
*float | sleep_per_packet = 0 ) |
Pass data to client in smaller parts.
max_size | Max packet size to send to client |
sleep_per_packet | Optional sleep interval per packet, seconds |
Reimplemented from pytest_userver.chaos.BaseGate.
None pytest_userver.chaos.UdpGate.to_server_concat_packets | ( | self, | |
int | packet_size ) |
Pass data in bigger parts.
packet_size | minimal size of the resulting packet |
Reimplemented from pytest_userver.chaos.BaseGate.
None pytest_userver.chaos.UdpGate.to_server_smaller_parts | ( | self, | |
int | max_size, | ||
*float | sleep_per_packet = 0 ) |
Pass data to server in smaller parts.
max_size | Max packet size to send to server |
sleep_per_packet | Optional sleep interval per packet, seconds |
Reimplemented from pytest_userver.chaos.BaseGate.
|
protected |
|
protected |