Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tcp python
#1
hello
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 ='192.168.1.15'
port = 123
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM
s.connect(('192.168.1.15', port))
s.send(b'CONNECT|Prova*')
while True:
    s.send(b'SERVER|Prova*')
while True:
    msg=s.recv(1024)
    print('Recived: ' + msg.decode())
    msg = s.recv(1024)
thank you
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020