• Post Reply Bookmark Topic Watch Topic
  • New Topic

UDP packet life

 
Tony Stark
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello and thanks for the feedback on the last post.

I have a question concerning the packet life in Java. I have a simple client server UDP scheme with a send call in the client side and a receive call in the server side. Lets say the send method gets called and the packet actually arrives in the other side BUT the server's code execution hasn't yet reached the receive method call. What happens with the packet in that time . Now i tried to stop the execution before the receive call with a simple command input prompt , waited a little and then let it continue and noticed that the packet got received . Can you explain WHY that happen.

Thanks in advance.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just because a process might temporarily not accept packets doesn't mean that it won't eventually. There are lots of buffers along the stages of a network connection that keep the data even if it can't be delivered right away.

Think of it like the email system - even if a mail can't be delivered right away (maybe because the target mail server is down), it is not returned to the sender straight away. Instead, delivery is attempted for some period of time (up to 72 hours, usually), and only then is the mail returned as undeliverable. It's a similar concept here, except that UDP is not guaranteed, so no notification of the sender is attempted - the packet will simply be discarded.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!