Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

nikeee/NetDiscovery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetDiscovery

A simple, small library for local area networks server discovery (DHCP-Like). Currently only supports IPv4 via Broadcast (no IPv6 Multicast).

As of 2019-05-21, this project is archived. If you're interested in doing something like this, you may want to use UPnP as it also supports IPv6 and does not rely on broadcasts (multicats instead).

Sample Usage

Client:

Discoverer severDiscoverer = new Discoverer(9007);
DiscoveryResult res = severDiscoverer.Discover();
if(!res.Canceled && !res.Error)
{
	var receivedEndpoint = res.OfferedEndPoint;
	// The sample client-server-application can now operate via the reveivedEndpoint (for example a chat)
}

Server:

// endPointForChat is the IPEndPoint the client-server-application actually uses (a chat, for example)
Discoverable clientHandler = new Discoverable(9007, endPointForChat);
clientHandler.ListenAsync() // handle client broadcast requests

// now the server has to listen for connections on endPointForChat

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages