[Mono-list] Has Anyone Read UDP Data with Mono?

Robert Jordan robertj at gmx.net
Sun May 9 15:24:34 EDT 2010


On 09.05.2010 19:35, Steve Ricketts wrote:
>
> Robert, thanks so much for trying to help me out.  I'm feeling like an idiot
> here.  I tried your sample and it's still not reading the data... just
> hanging on the sock.ReceiveFrom statement.  I am including my entire
> program.  I hard coded the IP/Port and tried 192.168.1.66 too.  I also
> changed Receive to return byte[] since that's what I'm sending to it (from
> an existing Windows application).  I've also included a packet from the
> sniffer output so you can see that there really is data coming to port 6267.
>

> 		public static void Main (string[] args)
> 		{
> 	        IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Parse
> ("127.0.0.1"), 6267);

This means that the server is only listening on localhost.
Are you sure that you want this?

Also, if the client is broadcasting messages (pretty typical
UDP usage), you are supposed to bind to IPAddress.Any, otherwise
you won't be able to receive broadcasts.

Robert



More information about the Mono-list mailing list