• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to avoid packet loss while using UDP sockets

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1, UDP client is multithreaded.
2, It creates and sends messages continuously.
3, While receiveing those messages in server i found some messages got lost.
4, Here the problem is the time taken to receive and the client keep on inserting messages continuously to datagram packet.
5, The client won't get any exception during message insertion into packets.
6, If already packet contains the data it may not able to insert into that.
7, At that time the packet is getting loss.
8, As soon as the messages in the packets have received by the server, the immediate message has inserted into packet and the previous message got lost.

Anybody of u please tell me how to solve this problem.

In my case i can't use TCP?IP according to the requirement.

I have to modification in client side or in server side.

Thanks
R.Ramya
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
UDP doesn't guarantee delivery of a packet. It's advantages over TCP are speed and packet size. Tacking on some sort of mechanism to UDP to guarantee delivery defeats the advantages of using UDP. If you NEED to guarantee delivery you SHOULD use TCP. It has a well-tested delivery mechanism and you don't have to reinvent the wheel with your own untested code. Unless this is an assignment for school, in which case, you should be doing your own work.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic