Bug 30871 - UdpClient receive bug
Summary: UdpClient receive bug
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: 4.0.0
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-06-06 19:49 UTC by Justin
Modified: 2017-09-01 11:34 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test receiver (4.14 KB, text/plain)
2015-06-06 19:49 UTC, Justin
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 30871 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Justin 2015-06-06 19:49:27 UTC
Created attachment 11494 [details]
Test receiver

I've been writing a simple program in C# making use of the UdpClient class.  I develop on Windows and copy the binary to my Linux box.

It seems that sometimes the array of Bytes received contain useful information, but sometimes the array consists only of 0x00s although the number of bytes received is correct.

This is what I'd see if sensible data was being received:

user@computer:~/folder$ ./ConsoleApplication1.exe
68 64 00 2A 71 61 00 AC CF 23 35 22 74 20 20 20 20 20 20 74 22 35 23 CF AC 20 20 20 20 20 20 53 4F 43 30 30 35 00 03 1E D9 00

68 64 00 2A 71 61 00 AC CF 23 35 22 74 20 20 20 20 20 20 74 22 35 23 CF AC 20 20 20 20 20 20 53 4F 43 30 30 35 04 03 1E D9 00

68 64 00 2A 71 61 00 AC CF 23 35 22 74 20 20 20 20 20 20 74 22 35 23 CF AC 20 20 20 20 20 20 53 4F 43 30 30 35 07 03 1E D9 00


Here's what I see, some of the time:

user@computer:~/folder$ ./ConsoleApplication1.exe
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00



It may be worth noting that in my main program, the first few arrays received are correct, then everything subsequent to that seems to be zeroed out.

I've attached a simple test program that prints out as above whatever it receives.  To try it, please send data to port 10000.
Comment 1 Justin 2015-06-09 09:03:50 UTC
Update:  If I use UdpClient.Receive() rather than UdpClient.BeginReceive()/EndReceive() then I seem to be getting much further!  So, it looks like the problem may be limited to the async methods.

Hope this is of use.