I'm teaching myself C# while working on a project (personal one) which is basically a p2p messenger. The thing is I want to pretty much remove the need for a server and because of such each client effectively works AS a server and a client.
Anyway quick question regarding instantiating a UdpClient with an IPEndPoint of IPEndPoint(IPAddress.Any, 0) had a look round and search but couldn't find anything that REALLY answered my questions: -
Does this mean that a udp packet incoming from any address (and now the main point of the question) and on any port will be received by the UdpClient? And what would happen if you have two or more such UdpClient's on a single machine? Will each get a copy of the packet? Or will one UdpClient arbitrarily receive it every time? Or maybe just throw an exception on attempting to instantiate the second? Does each UdpClient instantiated this way effectively bind a random open port or some such?
Ok that wasn't such a quick question
Basically I've got so far with the project coding using the socket class - realised I was borked where NAT traversal was concerned unless I was going to get into some pretty complex UPnP code then upgraded to .Net Framework 4 for the UdpClient.AllowNATTraversal() function.
Anyway I've only just started the UdpClient recode and this question has arisen so not got any code to show really, just working out the theory of how it should work in my head.
Sorry for rambling so much, better get on with some work work rather than my own projects , any help/comments greatly appreciated
This post has been edited by Mion: 19 May 2010 - 02:18 AM