poorconn.delay_before_sending_upon_acceptance_once

poorconn.delay_before_sending_upon_acceptance_once(s, t)

Delay t seconds before sending for all sockets returned by s.accept(), for once (first time only). Parameters mean the same as delay_before_sending_once().

This function achieves the results by patching the connection sockets’ member methods send() and sendall(). Their sendfile() methods are not patched due to their inconsistent behavior across operating systems.

Returns

A DelayBeforeSendingUponAcceptanceOnceController object that controls the patched socket object.

Parameters
  • s (socket.socket) –

  • t (float) –

Return type

poorconn._send.DelayBeforeSendingUponAcceptanceOnceController