I have a sketch for UNO + Ethernet shield which transfers data with clients on other platforms through a proprietary protocol. I would like to port this sketch on Yun without the Ethernet shield getting advantage of the built in Ethernet. Please, note that I can't change the client side which opens a socket and sends/receives data on it.
As far as I know I cannot use the Ethernet library without the shield.
Question is how do I manage incoming socket connection from the sketch ?
Likely, I have to write some php/python code on the linux side but how can I forward messages to the sketch ?
There are other similar cases on this forum and they have all been solved using YunServer and YunClient (which are drop in replacements for the Ethernet/Wifi counterparts)
The only two details you should need to care about are 1) the port (YunServer by default listens on port 5555, declare it with
YunServer server(1234);
in order to change the port to 1234, and 2) if the YunServer has to public or not (probably you want it public), hence, right after server.begin() add
server.noListenOnLocalhost()
Your sketch will then be able to accept incoming connections on port 1234 on every active network interface