bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Socket Response


From: Jim Hannula
Subject: Socket Response
Date: Fri, 12 Sep 2003 13:41:47 -0500 (CDT)
User-agent: SquirrelMail/1.4.0

A team of developers have been working on tunneling for for an application
using cvs.  We have most of the commands working.

The communication is as follows:
   Our client is cvs netbeans

   client sends via socket to tunneling servlet which sends via socket to
cvsPserver; cvsPserver returns data to tunneling servlet which returns
data to client

On a commit small files work.  Our problem on a commit is larger files.
The commit goes through from client to servlet to cvs. cvs returns data to
the servlet ok but the last three or four lines are cut off from the
servlet to the client.   What happens is the inputStream from the cvs
socket closes before it sends the last few lines to the client. See code
below:

byte[] lBuffer = new byte[32768];

do {
   lBufferLen = lSocketInputStream.read(lBuffer, 0, lBuffer.length);
   lTunnelOutputStream.write(lBuffer, 0, lBufferLen);
   lTunnelOutputStream.flush();
} while (lSocketInputStream.available() > 0);

lSocketInputStream is from the cvs server to the servlet
lTunnelOutputStream is from the tunneling servlet to the client.

When the following code is used the while loop hangs because the available
== 0 and the method never gets an EOF character.

byte[] lBuffer = new byte[32768];

 do {
    lBufferLen = lSocketInputStream.read(lBuffer, 0, lBuffer.length);
    if (lBufferLen > 0) {
        lTunnelOutputStream.write(lBuffer, 0, lBufferLen);
        lTunnelOutputStream.flush();
    }
 } while (lBufferLen >= 0);

It looks as if cvs does not send an EOF character. Any help would be
appreciated.

Thanks

Jim




reply via email to

[Prev in Thread] Current Thread [Next in Thread]