Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / November 2006

Tip: Looking for answers? Try searching our database.

UdpClient.Receive - polling or blocking

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Thielen - 01 Nov 2006 06:50 GMT
Hi;

I assumed that UdpClient.Receive() blocks and uses no CPU cycles until bytes
are received. However the ANTS profiler says it is taking a ton of time. Is
it polling or is this an ANTS problems where the thread is blocked but it
counts it as time executing code on the CPU?

Signature

thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

"Peter Huang" [MSFT] - 01 Nov 2006 09:17 GMT
Hi Dave,

You assumption is correct, if UDPClient.Receive will block until data
arrive.

I think you may try to use the Performance Monitor to track the Thread
Object in your application.
Here is the steps I use with the notepad application for demo.(Start
notepad first)
1. run Perfmon
2. Clear all the existing counter
3. Press Ctrl+I to add new counter
4. Select the computer to local computer
5. Select Thread in the Performance Object
6. Select % Processor Time in the Counter List
7. in the right listbox, select the Instance notepad/0(here the notepad is
the process image name and the 0 is the thread number, if your process
running udpclient have multiple threads, select them all)
8. Click Add
9. Now the Chart should be level to 0
10. we activate the notepad window, and we will find that a pulse occur,
the Counter will large than 0.
11. If we input something, the Chart will change.

You may try that steps in your scenario to see what is the result in your
scenario and let me know the result.
Thanks!

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
David Thielen - 01 Nov 2006 18:22 GMT
Thank you - I asked ANTS too and this is a bug in their profiler.

Signature

thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

> Hi Dave,
>
[quoted text clipped - 34 lines]
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.