[jcifs] Problem reading from named pipe

Sean Ryan sryan at clear-tec.com
Thu Feb 14 05:42:49 EST 2002


I am getting this exception when attempting to read from a named pipe :
 
jcifs.smb.SmbException: No description available. Please update error string
for errorCode=233
 java.lang.Throwable(java.lang.String)
 java.lang.Exception(java.lang.String)
 java.io.IOException(java.lang.String)
 jcifs.smb.SmbException(int)
 void jcifs.smb.SmbTransport.send(jcifs.smb.ServerMessageBlock,
jcifs.smb.ServerMessageBlock)
 void jcifs.smb.SmbSession.send(jcifs.smb.ServerMessageBlock,
jcifs.smb.ServerMessageBlock)
 void jcifs.smb.SmbTree.send(jcifs.smb.ServerMessageBlock,
jcifs.smb.ServerMessageBlock)
 void jcifs.smb.SmbFile.send(jcifs.smb.ServerMessageBlock,
jcifs.smb.ServerMessageBlock)
 int jcifs.smb.SmbFileInputStream.read(byte [], int, int)
 int jcifs.smb.SmbFileInputStream.read(byte [])
 int java.io.InputStreamReader.fill(char [], int, int)
 int java.io.InputStreamReader.read(char [], int, int)
 void java.io.BufferedReader.fill()
 java.lang.String java.io.BufferedReader.readLine(boolean)
 java.lang.String java.io.LineNumberReader.readLine()
 com.esuccess.citadel.test.sysadmin.Test(java.lang.String [])
 void com.esuccess.citadel.test.sysadmin.Test.main(java.lang.String [])

The code is as follows:
 
 try {
  SmbNamedPipe pipe =
   new SmbNamedPipe(
    "smb://ryan:madeup@hammerhead/IPC$/tran.dat",
    SmbNamedPipe.PIPE_TYPE_RDWR);
 
  InputStream is = pipe.getNamedPipeInputStream();
  OutputStream os = pipe.getNamedPipeOutputStream();
  InputStreamReader isr = new InputStreamReader(is);
  OutputStreamWriter osw = new OutputStreamWriter(os);
  BufferedWriter bw = new BufferedWriter(osw);
  LineNumberReader lnr = new LineNumberReader(isr);
  PrintWriter pw = new PrintWriter(bw, true);
 
  for (int i = 0; i < 10; i++) {
   pw.println(TRAN_RECORD);
//   Thread.sleep(1000);
   String s = lnr.readLine();
   System.out.println(s);
  }
 
 } catch (Exception e) {
  e.printStackTrace();
 }
 
The first iteration works, but on the second iteration the exception is
thrown.  If I put the "sleep" for 1 second in, I don't get the exception.  I
have narrowed it down to this part of the SmbTransport.send method :
 
 switch (response.errorCode & 0xFF) {
  case SmbException.SUCCESS :
   break;
  case SmbException.ERRDOS :
   switch ((response.errorCode >> 16) & 0xFFFF) {
    case SmbException.ERRnoaccess :
     throw new SmbAuthException(response.errorCode);
   }
   throw new SmbException(response.errorCode);
<<<<<<<<<<<<<<<----------------
  case SmbException.ERRSRV :
   switch ((response.errorCode >> 16) & 0xFFFF) {
    case SmbException.ERRbadpw :
    case SmbException.ERRaccess :
    case SmbException.ERRaccountExpired :
 
The value of response just before the exception is thrown is :
 
SmbComReadAndXResponse[command=SMB_COM_READ_ANDX,received=true,errorCode=No
description available. Please update error string for
errorCode=233,flags=0x0098,flags2=0x8001,tid=2048,pid=19719,uid=2048,mid=7,w
ordCount=0,byteCount=0,andxCommand=0xFF,andxOffset=0,dataCompactionMode=0,da
taLength=0,dataOffset=0]
 
The value of request just before the exception is thrown is :
 
SmbComReadAndX[command=SMB_COM_READ_ANDX,received=false,errorCode=0x00000000
,flags=0x0018,flags2=0x8001,tid=2048,pid=19719,uid=2048,mid=7,wordCount=12,b
yteCount=0,andxCommand=0xFF,andxOffset=0,fid=2048,offset=72,maxCount=4096,mi
nCount=4096,openTimeout=-1,remaining=0,offset=4096]
 
I am running within IBM VisualAge for Java 3.5 on Windows NT Workstation
4.0, and the process on the other end of the named pipe is a native NT
application running on locally on my machine.
 
Please let me know if you need any more information.
 
Regards,
Sean Ryan.
 

ClearTech Incorporated 

Sean Ryan
Development Manager
Citadel
Suite 1550, 13401-108th Avenue
Surrey BC V3T 5T3
CANADA
+1 (604) 588-6964 ext 307 (Voice)
+1 (604) 588-9332 (Fax)
< http://www.clear-tec.com/ <http://www.clear-tec.com/> > 


 
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the jcifs mailing list