• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Missing UDP Packets

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am using UDP for file send and receive. I know that, it is not reliable. But my boss advise to use UDP only. So, while receiving the packets (due to fast sending and slow receiving) some of the packets are missing. I already slow down the sending part. still some of the packets are missing. So, Can any one give me that code sample for, how to trace missing UDP packets and how to resend it back.

Thanks.

Regards,
Prabhakaran

 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
UDP is not reliable, so there is no notification for missing packets. Your code needs to decide when a packet is missing -maybe after a certain lapse of time-, and request it again from the sender, thereby duplicating what TCP does, but most likely much slower.

As an aside, it has already been pointed out that the underlying reason for using UDP instead if TCP is highly likely to be flawed; you should direct whoever told you otherwise to these discussions.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
UDP should only be used in case where missing one or two packets does not seriously affect the outcome - as in online games where each packet is a self-contained scene update.

Using UDP for file transfer is preposterous - you would have to reinvent TCP/IP or BitTorrent. Surely you have mis-understood your boss's requirement as no sensible IT person would ever say that.

Bill
 
Sheriff
Posts: 22644
123
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or the boss is in IT without having any knowledge of anything IT related. Unfortunately that happens. Try to convince him that UDP is really not a good solution; you can refer him to your other thread if he doesn't believe you. If he still doesn't believe you it may be time to look for another job. Any job with someone in charge who has no knowledge yet undermines your advice even with proper motivation is not a job I would like.
 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic