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 1
1
# Copied with minimal modifications from curio
2
2
# https://github.com/dabeaz/curio
3
3
4
- from concurrent .futures import ProcessPoolExecutor
5
4
6
5
import argparse
7
- from socket import *
8
6
import time
9
- import sys
7
+
8
+ from concurrent .futures import ProcessPoolExecutor
9
+ from socket import *
10
+
10
11
11
12
if __name__ == '__main__' :
12
13
parser = argparse .ArgumentParser ()
34
35
35
36
MSGSIZE = args .msize
36
37
37
- msg = b'x' * MSGSIZE
38
+ msg = b'x' * ( MSGSIZE - 1 ) + b' \n '
38
39
39
40
def run_test (n ):
40
41
print ('Sending' , NMESSAGES , 'messages' )
41
42
if unix :
42
43
sock = socket (AF_UNIX , SOCK_STREAM )
43
44
else :
44
45
sock = socket (AF_INET , SOCK_STREAM )
46
+
47
+ try :
48
+ sock .setsockopt (IPPROTO_TCP , TCP_NODELAY , 1 )
49
+ except (OSError , NameError ):
50
+ pass
51
+
45
52
sock .connect (addr )
46
53
while n > 0 :
47
54
sock .sendall (msg )
You can’t perform that action at this time.
0 commit comments