• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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: 43081
77
  • 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: 22821
132
Eclipse IDE Spring 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.
 
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic