Re: java socket input reading troubles
From: Danny Woods (no-mail-here_at_black.hole.com)
Date: 12/11/03
- Next message: Pat Ryan: "why is a superclass allowed to access protected methods of a subclass?"
- Previous message: Tivo Escobar: "Simple 2D Games Java API?"
- In reply to: Mohamed Naoufel Ben Salah: "java socket input reading troubles"
- Next in thread: Steve Horsley: "Re: java socket input reading troubles"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 11 Dec 2003 21:43:39 +0000
Mohamed Naoufel Ben Salah <Mohamed-Naoufel.Ben_Salah@alcatel.fr> writes:
> I have trouble getting all the data sent by the server,
> what I receive is a sequence of packets 1,2,3 ...
> I receive 1 then 2 and when I read the next it is number
> 4 or 5.
The first question would have to be whether you're using a Socket or
DatagramSocket? If it's a DatagramSocket, then missing or out-of-order data
is just a fact of life: if you require reliable data transfer over UDP, you'll
need some additional protocol to detect missing data and re-request holes in
the packet stream (something that the server will have to support).
If it's a plain TCP-based java.net.Socket and you're receiving data out
of order, then something's seriously amiss, as the protocol itself
explicitly protects against this (failing rather than missing data or
delivering it unordered).
In any case, the Ethereal network analysis tool is invaluable for tracking
this kind of stuff down (http://www.ethereal.com). Provided the client
and the server are on different machines, you'll be able to tell exactly
which data is being sent to/from your box (it doesn't work with the loopback
address).
Failing that, posting some code might allow people to help more effectively.
Regards,
Danny.
- Next message: Pat Ryan: "why is a superclass allowed to access protected methods of a subclass?"
- Previous message: Tivo Escobar: "Simple 2D Games Java API?"
- In reply to: Mohamed Naoufel Ben Salah: "java socket input reading troubles"
- Next in thread: Steve Horsley: "Re: java socket input reading troubles"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|