[jcifs] Batching command in CIFS

Cellina Lin cellina at gmail.com
Sat Jan 29 12:38:17 GMT 2005


Thanks. 
I tried to prototype a methed  ReadAndClose() as below.

public class BatchingTests extends SmbFile {
    public void ReadAndClose() throws SmbException {

        byte[] b = new byte[1024];
        
        SmbComReadAndX req1 = new SmbComReadAndX(fid, fp, 10, new
SmbComClose( fid, 0L ));
        SmbComReadAndXResponse resp1 = new SmbComReadAndXResponse(b, 0);
        
        send(req1,resp1);        
    }  
}

However, when I call this methed, the FID in the batched command,
SMB_COM_CLOSE, is not the same FID as in the first command,
SMB_COM_READ_ANDX and thus got error response .
I tried to modify the fid parameter in SmbComClose(), and got strange
result.  It's not even the integer I set. It seems that
writeParameterWordsWireFormat() of class SmbComClose has some
problem....

Could anyone help?




On Thu, 27 Jan 2005 18:53:29 -0500 (EST), Michael B Allen
<mba2000 at ioplex.com> wrote:
> Christopher R. Hertel said:
> >> What should I put in the first parameter of SmbComReadAndX() call if I
> >> want to batch it with SmbComNTCreateAndX ()?
> >
> > Try zero.
> 
> Right.
> 
> Mike
>


More information about the jcifs mailing list