I'm discovering network using UDP broadcast like https://stackoverflow.com/a/22853295/13117660.

I have tried 4 different options.

LAN Server/LAN Client LAN Server/WIFI Client WIFI Server/LAN Client WIFI Server/WIFI CLIENT

Options 1. 2. and 4. work like a charm. Clients find the Server send some data, Server responds and Clients do something with that data.

But when I try option 3. (where my Server is running on a laptop that has WIFI connection and my Client is running on another laptop that has LAN connection) the Client doesn't find the Server. Client sends a message but Server doesn't receive it.

Server and Client are both connected to the same router.

I have managed to bypass this problem on one router by sending the message to When using regular broadcast address message wasn't received. (Default Gateway is

But when trying this on another router (Default Gateway it won't work in both cases. Even if I'm sending a packet to or

Can you tell me why is this happening? Can I somehow get pass this problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.