Reg: DatagramSocket

Dear friends,

I have one problem regarding the 'DatagramSocket'.. I have created one DatagramSocket and bound to some port.. It is receiving packets inside an infinite while loop... I have sent 1000 packets in one second but it's receiving only 200-250 packets... Why it happened? Please tell me what may be the problem?

[336 byte] By [hareesh_84a] at [2007-11-27 11:53:17]
# 1

maybe you are sending them in such quick succession that some are being skipped.. try pausing for a 100 ms or so between each packet being sent.

smithdale87a at 2007-7-29 18:49:25 > top of Java-index,Java Essentials,Java Programming...
# 2

> Dear friends,

> I have one problem regarding

> the 'DatagramSocket'.. I have created one

> DatagramSocket and bound to some port.. It is

> receiving packets inside an infinite while loop... I

> have sent 1000 packets in one second but it's

> receiving only 200-250 packets... Why it happened?

>Please tell me what may be the problem?

The problem is that it's UDP. And with UDP **** happens.

This shouldn't be important. If it is important then you shouldn't be using UDP. You should be using TCP.

cotton.ma at 2007-7-29 18:49:25 > top of Java-index,Java Essentials,Java Programming...
# 3

ok. What is the maximum socketBufferSize that we can set for a DatagramSocket ?

hareesh_84a at 2007-7-29 18:49:25 > top of Java-index,Java Essentials,Java Programming...
# 4

> ok. What is the maximum socketBufferSize that we can

> set for a DatagramSocket ?

It depends.

Would you like the other side to actually receive any of these packets?

cotton.ma at 2007-7-29 18:49:25 > top of Java-index,Java Essentials,Java Programming...