The title really says it all, but here is a brief explanation of what I need.
I need to open a socket on the Yun so that I constantly send data back a forth from my Yun to an application on a computer. Please post also if you know anything on UDP broadcasting.
My plan is that I send a UDP broadcast so that the application on my computer says "Hey I found your Yun! :)" then I open a connection to it using a TCP connection so I can send and receive data.
Belpois:
My plan is that I send a UDP broadcast so that the application on my computer says "Hey I found your Yun! :)" then I open a connection to it using a TCP connection so I can send and receive data.
You could do it like that but if you were to look at similar protocols, you would find the problem turned around. The 'server' advertises the 'service' which the clients connect to. The broadcast is sent from one place, informing clients where they can find a listening socket. This helps reduce network overheads and the complexity of establishing a session.
As an alternative to a 'broadcast' sent to the subnet broadcast address, you might consider a more interface and router friendly 'multicast.'
MattS-UK:
You could do it like that but if you were to look at similar protocols, you would find the problem turned around. The 'server' advertises the 'service' which the clients connect to. The broadcast is sent from one place, informing clients where they can find a listening socket. This helps reduce network overheads and the complexity of establishing a session.
As an alternative to a 'broadcast' sent to the subnet broadcast address, you might consider a more interface and router friendly 'multicast.'
I agree, actually that's what I wanted to do, I simply failed to explain my self better Sorry about that.
Any one knows of any python libraries that would allow this though? or can I just use the usual python sockets?
You can use the usual python sockets. I don't know about python particularly but I know about the Sockets API.
The Sockets API is a standardised wrapper around the underlying
Socket structures being maintained by the OS. 'Sockets,' describes
a standardised behaviour.
Whichever development environment you use, if it provides a Sockets API
the functionality will be more or less the same.