Re: java socket input reading troubles

From: Danny Woods (no-mail-here_at_black.hole.com)
Date: 12/11/03


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.



Relevant Pages

  • Re: java socket input reading troubles
    ... If it's a DatagramSocket, then missing or out-of-order data ... the packet stream (something that the server will have to support). ... Failing that, posting some code might allow people to help more effectively. ...
    (comp.lang.java.programmer)
  • RE: Add a server to SBS R2 using ConnectComputer
    ... server in the SBS network, ... Let's try following steps to see if we can add the computer to SBS network ... Microsoft Online Newsgroup Support ... It looks like from a previous thread I may be missing some. ...
    (microsoft.public.windows.server.sbs)
  • RE: Add a server to SBS R2 using ConnectComputer
    ... server in the SBS network, ... some virtual web sites are missing. ... Let's try following steps to see if we can add the computer to SBS network ... It looks like from a previous thread I may be missing some. ...
    (microsoft.public.windows.server.sbs)
  • RE: Add a server to SBS R2 using ConnectComputer
    ... server in the SBS network, ... Let's try following steps to see if we can add the computer to SBS network ... Microsoft Online Newsgroup Support ... It looks like from a previous thread I may be missing some. ...
    (microsoft.public.windows.server.sbs)
  • Re: Missing Menus
    ... I totally rebuilt the server, ... and I still have no menus. ... The menus are missing from all templates. ...
    (microsoft.public.sharepoint.windowsservices)