I am creating tcp ip listener in python . Kindly help me how to solved this problem
1 ) when I send data from client server received data and stop connection with client .
2.) I want to received data from 3 Clint's in same time .
1 ) when I send data from client server received data and stop connection with client .
2.) I want to received data from 3 Clint's in same time .
Python:
import socket
ip = "127.0.0.1"
port= 1234
server = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
server.bind((ip,port))
server.listen(5)
while True:
client,address= server.accept()
print(f"Connection Establish - {address[0]}: {[1]}")
string = client.recv(1024)
string=string.decode("utf-8")
print(string)
string1= (string)
with open('mytcpip.txt','w') as f:
f.write(string1)
f.write('\n')