newly created test server works so why the fuck does my other server not work
This commit is contained in:
@@ -17,15 +17,15 @@ class MyClass():
|
||||
|
||||
connected = True
|
||||
while connected:
|
||||
msg_length = conn.recv(HEADER).decode(FORMAT)
|
||||
msg_length = conn.recv(self.HEADER).decode(self.FORMAT)
|
||||
if msg_length:
|
||||
msg_length = int(msg_length)
|
||||
msg = conn.recv(msg_length).decode(FORMAT)
|
||||
if msg == DISCONNECT_MESSAGE:
|
||||
msg = conn.recv(msg_length).decode(self.FORMAT)
|
||||
if msg == self.DISCONNECT_MESSAGE:
|
||||
connected = False
|
||||
|
||||
print(f"[{addr}] {msg}")
|
||||
conn.send("Msg received".encode(FORMAT))
|
||||
conn.send("Msg received".encode(self.FORMAT))
|
||||
conn.close()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user