I have a device - a closed device - that sends data to an IP address at a specific port. I am working on making a smarter controller using the Raspberry Pi 2. Although this is on the Pi 2 it is somehting I have tested on Computer to Computer. All works well if I can have a Server - Client as in the Internet Communications example. However on the real device that sends data I cannot setup a Server-Client connection as the other side is a closed device where I cannot add either a Server or Client app.
My question is what and how do I enable listening on a TCP:Port so I can then act on data being sent-received?
I have attempted multiple combinations of the Client side examples without success such as:
mCurrentSocket = 0
SCG_TCPSocket(mCurrentSocket).Port = IPPort
SCG_TCPSocket(mCurrentSocket).Address = TCPIP
SCG_TCPSocket(mCurrentSocket).Connect
mCurrentSocket = mCurrentSocket + 1
Where TCPIP = a string containg a valid IPv4 address
Where IPPort = an integer of the port I need to listen for data on
When data is sent from the other side to the Port nothing comes in the DataAvailable Event Handler
I can ping the other device. Any thoughts?