Autodiscovery of LAN devices
Alex Tweedly
alex at tweedly.net
Thu Oct 27 20:39:17 EDT 2016
Richard,
it might help if you were to more precisely describe the problem you are
seeking to solve.
If you need to discover all/any/arbitrary listeners - then "what Bob said".
If you need to discover listeners for a specific port/service provided
by some other apps/servers in a standard way - then "what Monte said".
If you need to discover instances of "your own" server on the LAN, then
there may be an other solution..... depending on how well defined "my
LAN" is.
Basically,
- every server listens for UDP packet on some port
- client sends a broadcast UDP request to that port
- servers respond.
This assumes that you can *reliably* depend on your LAN being a single
subnet, that your LAN is not too huge :-), that all servers are within
your control and you can add such a listener to them, etc.
NB - this is only a solution for desktops (only they can send broadcasts).
For ios you can use mergSomething :-)
For Android, afaik there isn't anything to allow broadcast transmission,
so I think your only solution for now is to move to a
broadcast/advertisement approach - servers (currently desktop only, you
said) must advertise their service, and Android clients can listen for
such adverts and thus learn where the service is available. This is only
feasible if you know of limits on the number of servers & services - or
(for-android as-client) if you are willing to add significant complexity
and have proxy-servers handle it for you; you can do that in an
automatic way (i.e. no configuration needed) but it is complex.
Don't even start down that road unless you need this for Android before
the timeframe for either bonjour or sockets on android.
(But if you do want to go down that road, get in touch I'd be happy to
collaborate)
-- Alex.
On 27/10/2016 22:12, Richard Gaskin wrote:
> I'd like to have an app automatically discover and attempt connection
> to other devices on my LAN.
>
> Looking through the list archives I can find a few half-solutions, but
> not one which works well across the platforms LC supports (Mac, Win,
> Linux, iOS, Android).
>
> At this time the only things listening on a port will be desktop
> computers, but I still need to be able to connect with them from any
> other device on the local network, and down the road I may want to
> allow even handheld devices to take on an accept role.
>
> Any robust, tested solutions available?
>
More information about the use-livecode
mailing list