Package jcifs.smb1.util.transport
Class Transport
- java.lang.Object
-
- jcifs.smb1.util.transport.Transport
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
SmbTransport
public abstract class Transport extends Object implements Runnable
This class simplifies communication for protocols that support multiplexing requests. It encapsulates a stream and some protocol knowledge (provided by a concrete subclass) so that connecting, disconnecting, sending, and receiving can be syncronized properly. Apparatus is provided to send and receive requests concurrently.
-
-
Field Summary
Fields Modifier and Type Field Description protected HashMapresponse_map
-
Constructor Summary
Constructors Constructor Description Transport()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidconnect(long timeout)voiddisconnect(boolean hard)protected abstract voiddoConnect()protected abstract voiddoDisconnect(boolean hard)protected abstract voiddoRecv(Response response)protected abstract voiddoSend(Request request)protected abstract voiddoSkip()protected abstract voidmakeKey(Request request)protected abstract RequestpeekKey()static intreadn(InputStream in, byte[] b, int off, int len)voidrun()voidsendrecv(Request request, Response response, long timeout)StringtoString()
-
-
-
Field Detail
-
response_map
protected HashMap response_map
-
-
Method Detail
-
readn
public static int readn(InputStream in, byte[] b, int off, int len) throws IOException
- Throws:
IOException
-
makeKey
protected abstract void makeKey(Request request) throws IOException
- Throws:
IOException
-
peekKey
protected abstract Request peekKey() throws IOException
- Throws:
IOException
-
doSend
protected abstract void doSend(Request request) throws IOException
- Throws:
IOException
-
doRecv
protected abstract void doRecv(Response response) throws IOException
- Throws:
IOException
-
doSkip
protected abstract void doSkip() throws IOException- Throws:
IOException
-
sendrecv
public void sendrecv(Request request, Response response, long timeout) throws IOException
- Throws:
IOException
-
doDisconnect
protected abstract void doDisconnect(boolean hard) throws IOException- Throws:
IOException
-
connect
public void connect(long timeout) throws TransportException- Throws:
TransportException
-
disconnect
public void disconnect(boolean hard) throws IOException- Throws:
IOException
-
-