Add bufferSize option to translation tools

This commit is contained in:
Fierelier 2021-04-24 06:59:39 +02:00
parent 479c5496cf
commit 1890b316f5
2 changed files with 4 additions and 2 deletions

View File

@ -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:

View File

@ -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)