Currently trying to create requests that were extracted from Wireshark for honing my networking skills. I've got the location, destination port, and the message itself, but each time I attempt to send the request I am returned with just a blank empty byte. All I could conclude is that the difference between the original packets and mine are that my ports must be different, as the sending ports are different.
This is the code I have tested:
TCP_IP = '111.111.111.111' # destination address
TCP_PORT = 19999 #destination port
BUFFER_SIZE = 20 # for quicker receiving
MESSAGE = b'<Message />' # dest message
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send(MESSAGE)
data = s.recv(BUFFER_SIZE)
s.close()
print("received data:", data) #b''
Which nets me with the empty byte after hanging for a few seconds.
So, the trouble seems to be from the differing packet sending ports on my own computer. Any help/thoughts are greatly appreciated.
This is the code I have tested:
TCP_IP = '111.111.111.111' # destination address
TCP_PORT = 19999 #destination port
BUFFER_SIZE = 20 # for quicker receiving
MESSAGE = b'<Message />' # dest message
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send(MESSAGE)
data = s.recv(BUFFER_SIZE)
s.close()
print("received data:", data) #b''
Which nets me with the empty byte after hanging for a few seconds.
So, the trouble seems to be from the differing packet sending ports on my own computer. Any help/thoughts are greatly appreciated.
I do automation in new ways, build tools, great SaaS' and derive great value and ideas out of simple concepts - always looking for new profitable projects to get involved in.


