Y_Y
Y_Y

Reputation: 1285

Is there a way to locate a TCP Server running under local network?

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?

Upvotes: 0

Views: 294

Answers (1)

dtb
dtb

Reputation: 217313

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.

Upvotes: 2

Related Questions