|
@@ -42,13 +42,14 @@ while True:
|
|
|
tsock.listen(1)
|
|
|
|
|
|
# now put logic for TCP socket behaviour
|
|
|
- while True:
|
|
|
- tempsock, addr = tsock.accept()
|
|
|
- msg = tempsock.recv(1024).decode()
|
|
|
- print("SERVER_RCV_MSG='", msg, "'", sep="")
|
|
|
- reply = msg[::-1]
|
|
|
- tempsock.send(reply.encode())
|
|
|
- tempsock.close()
|
|
|
+ #while True:
|
|
|
+ tempsock, addr = tsock.accept()
|
|
|
+ msg = tempsock.recv(1024).decode()
|
|
|
+ print("SERVER_RCV_MSG='", msg, "'", sep="")
|
|
|
+ reply = msg[::-1]
|
|
|
+ tempsock.send(reply.encode())
|
|
|
+ newConn = True
|
|
|
+ tempsock.close()
|
|
|
|
|
|
# match, send a confirmation msg
|
|
|
elif (newConn == False and message == rport):
|