Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to avoid packet loss while using UDP sockets

 
Ramya Dhurga
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!