Android Question available users on a network

Mansie

Member
Licensed User
Longtime User
Simple question - as users log into a network that I am already logged into, can I get their IP address and port number? I'm looking for the functionality of 'bonjour' on apple
 

Mansie

Member
Licensed User
Longtime User
Thanks Erel. I'm assuming the other devices would be running my app. Is there any way of using a wild card in the IP / port address so I could send out messages to all attatched devices snd they could send me their details (port num, etc).

I'm trying to develop a local area network chat system in which users simply log into the network and run my app to start. I'm using UDP.

Many thanks
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
yesterday you asked this on the chat aswell but I answered when you just left.

you talked about a public access hotspot.

on these devices get isolated so you can't even see or connect to another device on that hotspot network unless it's secured and unisolated.

one of the only options left is to use a middleware server where they poll for available messages every minute or so.
 
Upvote 0

Mansie

Member
Licensed User
Longtime User
Hi Sorex/Erel

I would probably provide a wireless router for users to log onto.

That said - it is possible to communicate directly to other users in a hotspot if you exchange IP addresses and port numbers. I know this works because I've tried it with my app in a number of venues without issues.

All I want is to be able to allow the users to bypass this manual exchange of IP addresses and port numbers.

Mansie
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
you can use a socket connect loop going from 192.168.x.1 to 192.168.x.254 and when it connects successfully to the port you specified you're fine I guess.
 
Upvote 0

Troberg

Well-Known Member
Licensed User
Longtime User
you can use a socket connect loop going from 192.168.x.1 to 192.168.x.254 and when it connects successfully to the port you specified you're fine I guess.

Assuming that's the address range used. On larger networks, 10.x.x.x is also quite common.

However, just taking your own IP and then cycle through all the values in the last byte would work in most cases. Some networks would consider that a dis-allowed port scan, though.
 
Upvote 0
Top