poorconn.delay_before_sending¶
-
poorconn.
delay_before_sending
(s, t, length=1024)¶ Chop the content (
bytes
insocket.socket.send()
andsocket.socket.sendall()
) to be sent inlength
bytes and delayt
seconds before sending every time.This function achieves the results by patching
s
’s member methodssend()
andsendall()
.s
’ssendfile()
method is not patched due to its inconsistent behavior across operating systems.- Parameters
- Returns
A
DelayBeforeSendingController
object that controls the patched socket object.- Return type
poorconn._send.DelayBeforeSendingController