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 / New Users / December 2004

Tip: Looking for answers? Try searching our database.

UDP Socket Timing Out?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom Kent - 01 Dec 2004 21:58 GMT
I'm not a huge expert on UDP or sockets, so I was hoping someone could help
me out.

I have a C# app that sends three large (3KB) unicast datagrams out at user-
defined intervals (when they push a button) so this can happen every couple
seconds or every several minutes.  Anyway, every time the application sits
for a few minutes and then the user tries to send, the first of the three
datagrams does not get to the recipiant.  However, the socket does not
error and indicates that the correct number of bytes was sent.  

I believe this also happens the first time after I startup.  However, it
doesn't seem that re-starting the application changes the situation.  (I
can restart and hit send within a few seconds and all three get through).

I'm not sure what other data would be useful in figuring this out, let me
know if there's anything important I'm missing.

Thanks!
Tom

P.S.  Does the SetSocketOption KeepAlive have anything to do with this?  I
was only able to find examples of it being used with TCP.
Yechezkal Gutfreund - 01 Dec 2004 22:39 GMT
You are aware, no doubt, that UDP does not guarantee delivery. You need TCP
for that (which does a handshake). UDP just throws the packet out there and
always indicates that it was sent. But you have to write your own handshake
mechanism and resend to guarnatee delivery (there are many papers on this).

> I'm not a huge expert on UDP or sockets, so I was hoping someone could
> help
[quoted text clipped - 21 lines]
> P.S.  Does the SetSocketOption KeepAlive have anything to do with this?  I
> was only able to find examples of it being used with TCP.
Tom Kent - 02 Dec 2004 19:16 GMT
Yeah, I was aware of this.  At this point, we don't have a good way
around this.  Its one of those things where we've been using UDP forever
and I'm not in any position to change it :-(  

On the other side of the issue, we have been using UDP forever, and we've
never experienced any major packet loss.  Also, this doesn't appear to be
related directly to too much network traffic, as it only happens on the
first of the three datagrams.  I was wondering if I was missing something
that was causing it to not start correctly.  Basically I don't have the
option of implementing any reliability, so I wanted to do all the tweaks
possible to make it as reliable as possible.

Thanks,
Tom

> You are aware, no doubt, that UDP does not guarantee delivery. You
> need TCP for that (which does a handshake). UDP just throws the packet
[quoted text clipped - 29 lines]
>> P.S.  Does the SetSocketOption KeepAlive have anything to do with
>> this?  I was only able to find examples of it being used with TCP.
William Stacey [MVP] - 03 Dec 2004 02:57 GMT
1) Use NetMon to see if you getting the UDP reply back or is being dropped
at the server or the client.
2) When you know that, you can add debug output and try/catch block output
to see what is happening.

Without any of that, it is a bit like shooting in the dark.

Signature

William Stacey, MVP
http://mvp.support.microsoft.com

> Yeah, I was aware of this.  At this point, we don't have a good way
> around this.  Its one of those things where we've been using UDP forever
[quoted text clipped - 44 lines]
> >> P.S.  Does the SetSocketOption KeepAlive have anything to do with
> >> this?  I was only able to find examples of it being used with TCP.

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.