Python Forum

Full Version: tcp python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i want with python send message to server
I want to send messages to the server even if the server is not sending anything to the clients
or both together
I have tried with this
but if the server does not send anything to the client I cannot send anything
There is a solution?
this is the code i tried
import socket
host =''
port = 123
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM
s.connect(('', port))
while True:
while True:
    print('Recived: ' + msg.decode())
    msg = s.recv(1024)
thank you