Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Apr : How to explain this UDP behaviour

www.cryer.info
Managed Newsgroup Archive

How to explain this UDP behaviour

Subject:How to explain this UDP behaviour
Posted by:"Georgi Sandev" (georgi_sand..@atianet.bg)
Date:Thu, 14 Apr 2005 06:36:27

Hello
I have the following problem... and several questions
well not actually a problem but my client/server udp application works
behaves strangely.
what I mean is:
udp client sends a datagram to the udp server. then it waits for five
seconds to get a response
if no response is received then it sends another datagram and waits five
more seconds again...
this process repeats 5 times. If all of the five attemts fail the client
throughs out a custom message and quits.
Here is actually what happens when I run the application.
In a LAN there are no problems the datagram is send and received by the
cilen in the first attempt and everything is fine
In internet however sometimes it happens that all the five steps fail and no
datagram is received.
(Debugging the server I see that it receives the first datagram and it seems
that the client does not receive any response)
When I start client application for the second time (5 more attempts) it
succeeds in the first attempt or the second.
Then I have no more problems when starting the client application - they
allways shake hands in the first attempt.
Even if I start it later and even two days after the failure I have no
problem with communication.
Can you explain this behaviour - is this normal for udp
I tested this with several remote clients some of them running in a LAN and
some of them directly connected to internet.
In all the case I always succeed but in some of the cases I have to restart
client application and the success comes in the seccond 5-times session.
Also - shall I wait for 5 seconds to get a response from server or this is
quite a lot of time to wait for?

Regards

Replies:

www.cryer.info
Managed Newsgroup Archive