views:

45

answers:

1

Is there a way to locate a TCP Server running under local network using raw sockets and C#?

-The Client searching for the Server is running under the same local network as the Server and it knows the port the Server is running with.

-is it by Broadcast?

+2  A: 

Yes it's possible to do this with the Socket class if the server sends UDP broadcasts on a periodic basis or in response to a solicitation. The client would have to listen for UDP broadcasts and optionally send a solicitation to discover the server.


If you're not strictly limited to the Socket class, have a look at DNS-SD / Zero configuration networking. This has been invented for the exact purpose of discovering services on a local network.

dtb