File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 11# Copied with minimal modifications from curio
22# https://github.com/dabeaz/curio
33
4- from concurrent .futures import ProcessPoolExecutor
54
65import argparse
7- from socket import *
86import time
9- import sys
7+
8+ from concurrent .futures import ProcessPoolExecutor
9+ from socket import *
10+
1011
1112if __name__ == '__main__' :
1213 parser = argparse .ArgumentParser ()
3435
3536 MSGSIZE = args .msize
3637
37- msg = b'x' * MSGSIZE
38+ msg = b'x' * ( MSGSIZE - 1 ) + b' \n '
3839
3940 def run_test (n ):
4041 print ('Sending' , NMESSAGES , 'messages' )
4142 if unix :
4243 sock = socket (AF_UNIX , SOCK_STREAM )
4344 else :
4445 sock = socket (AF_INET , SOCK_STREAM )
46+
47+ try :
48+ sock .setsockopt (IPPROTO_TCP , TCP_NODELAY , 1 )
49+ except (OSError , NameError ):
50+ pass
51+
4552 sock .connect (addr )
4653 while n > 0 :
4754 sock .sendall (msg )
You can’t perform that action at this time.
0 commit comments