My clients connect with my TCP server code, below, but I'd like to obtain the client's PORT number from the joining TCP packet.
Last time I did this, I stored the PORT number in the joining packet's data array bytes.
Is that the correct way to do it?
I've hardcoded it to 8080 now, should I just acquire the PORT number from 2 bytes in the data, not the packet object's networking properties?
(clientsocket, address) = serversocket.accept()
print("TCP joined from : ", address)
print("(TCP recv wait:")
data = clientsocket.recv(JOIN_BUFFER_SIZE)
# Analyze msg for joining clients
print("Msg Type = ")
if data == 1 :
clients.append(ClientInfo(address, countingClients,8080)) # already had clients =  way above, and, countingClients=0