Results 1 to 1 of 1
Thread: UDP Receive Problem
- 04-27-2010, 10:56 AM #1Member
- Join Date
- Apr 2010
- Rep Power
UDP Receive Problem
I have a UDP 'server' setup to continuously listen for UDP datagrams.
This uses DatagramSocket to listen on the port, and specifies a DatagramPacket with a buffer size of 65535 to receive.
When I send small amounts of data, this has been working fine. When I send larger amounts, which are larger than one datagram, I have problems. The first datagram is received which contains part of the message, but the second datagram does not seem to be received until I send more data to the server.
It is as though it is waiting for the full buffer to be filled before the second datagram gets processed. But as the smaller packets are received without problem then this doesn't make sense.
Am I doing something wrong, or is it in theory correct to loop on receiving UDP packets set to a buffer of their max size? Note I have tried using a smaller buffer but then the packets are chopped and data is lost.
Thanks in advance for any help,
- By amita110486 in forum New To JavaReplies: 3Last Post: 03-17-2010, 03:07 PM
- By ashoksaravanan in forum Web FrameworksReplies: 1Last Post: 02-22-2010, 10:11 AM
- By ashrafraheem in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 09-27-2009, 02:16 AM
- By firstname.lastname@example.org in forum NetworkingReplies: 0Last Post: 12-02-2008, 10:55 AM
- By Felissa in forum Java ServletReplies: 1Last Post: 06-07-2007, 07:22 PM