Add bufferSize option to translation tools
This commit is contained in:
parent
479c5496cf
commit
1890b316f5
|
@ -21,6 +21,7 @@ sp = pUp(s)
|
|||
import socket
|
||||
import threading
|
||||
import queue
|
||||
bufferSize = 1000
|
||||
|
||||
def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs)
|
||||
|
||||
|
@ -34,7 +35,7 @@ class pipeThread(threading.Thread):
|
|||
def run(self):
|
||||
global connection
|
||||
while True:
|
||||
data = sys.stdin.buffer.read(1000)
|
||||
data = sys.stdin.buffer.read(bufferSize)
|
||||
|
||||
with connectionLock:
|
||||
try:
|
||||
|
|
|
@ -19,6 +19,7 @@ sp = pUp(s)
|
|||
|
||||
# script start
|
||||
import socket
|
||||
bufferSize = 1000
|
||||
|
||||
def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs)
|
||||
|
||||
|
@ -44,6 +45,6 @@ while True:
|
|||
eprint("Connection established, receiving data.")
|
||||
connection.settimeout(15)
|
||||
while True:
|
||||
data = connection.recv(1000)
|
||||
data = connection.recv(bufferSize)
|
||||
if data == b"": break
|
||||
sys.stdout.buffer.write(data)
|
Loading…
Reference in New Issue