I have a simple program designed to send raw text data over a TCP socket. I'm thinking this is a buffering problem; but I am not sure. No data appears to be sent.
from threading import Thread as thread
from sys import argv
from socket import socket
from tty import setraw
from sys import stdin
from sys import stdout
def rx(so):
while True:
stdout.write(so.recv(1).replace("\n", "\n\r"))
setraw(stdin.fileno())
so = socket()
so.connect((argv[1], int(argv[2])))
thread(target=rx, args=(so, )).start()
while True: so.send(stdin.read(1))
EDIT to clarify: Keyboard data is not being sent.