[jcifs] Named pipe timeouts

Josh Cooper josh.nw at gmail.com
Wed Feb 6 21:30:07 GMT 2008


I'm using jcifs 1.2.17 to see if a named pipe is available, and if so, read from
it. 

If the pipe is available, then data may not be written to it for several hours.
Therefore, I'd like to block for a "long time" while reading from
SmbFileInputStream until I get data, EOF, or an IOException. But I'd like to use
the default timeouts for everything else, e.g. tree connect, PeekNamedPipe, etc.

The following code in SmbFileInputStream, line 145, made me think jcifs already
worked that way:

  if( file.type == SmbFile.TYPE_NAMED_PIPE ) {
     response.responseTimeout = 0;
  }

But the response.responseTimeout is never used anywhere, and instead jcifs times
out during read (I'm using the default jcifs.smb.client.responseTimeout):

jcifs.util.transport.TransportException: Transport1 timedout waiting for
response to
SmbComReadAndX[command=SMB_COM_READ_ANDX,received=false,errorCode=0,flags=0x0018,
flags2=0xC003,signSeq=0,tid=2048,pid=50131,uid=2048,mid=75,wordCount=12,
byteCount=0,andxCommand=0xFF,andxOffset=0,fid=16384,offset=0,maxCount=1024,
minCount=1024,openTimeout=-1,remaining=1024,offset=0]
at jcifs.util.transport.Transport.sendrecv(Transport.java:76)
at jcifs.smb.SmbTransport.send(SmbTransport.java:606)
at jcifs.smb.SmbSession.send(SmbSession.java:239)
at jcifs.smb.SmbTree.send(SmbTree.java:109)
at jcifs.smb.SmbFile.send(SmbFile.java:695)
at jcifs.smb.SmbFileInputStream.readDirect(SmbFileInputStream.java:160)
at jcifs.smb.SmbFileInputStream.read(SmbFileInputStream.java:121) 

So is something broken that used to work?

TIA,
Josh



More information about the jcifs mailing list