views:

235

answers:

2

I have a server application that needs to find and exchange small amounts of data with other instances of itself on a local LAN.

This is not a critical piece of the application.

It must be done peer to peer without a central server or advance configuration.

Are there any existing libraries that do something like this?


EDIT

I should mention I am using .NET 2.0 and prefer something based on Windows sockets.

+2  A: 

C4F Vista Peer-to-Peer Toolkit

http://www.codeplex.com/C4FP2P

MicTech
+3  A: 

If you're only concerned with a local LAN, a simple broadcast protocol should work. Have each client listen on a particular port (probably in a separate thread). When one client wants to communicate, have it broadcast on that port to the local network. Each listening client should then respond with it's connection information -- what address/port it uses for accepting data. The sending client can then choose which client(s) to send the data to and connect to that(those) client(s) normally.

Alternatively, if the data is not sensitive and delivery doesn't need to be reliable, you could simply broadcast the information, along with the information on which client is the intended recipient, and let the client(s) that are interested pick it up.

tvanfosson