jcifs.util.transport
Class Transport
java.lang.Object
jcifs.util.transport.Transport
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- SmbTransport
- public abstract class Transport
- extends java.lang.Object
- implements java.lang.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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
response_map
protected java.util.HashMap response_map
setupDiscoLock
public java.lang.Object setupDiscoLock
Transport
public Transport()
readn
public static int readn(java.io.InputStream in,
byte[] b,
int off,
int len)
throws java.io.IOException
- Throws:
java.io.IOException
makeKey
protected abstract void makeKey(Request request)
throws java.io.IOException
- Throws:
java.io.IOException
peekKey
protected abstract Request peekKey()
throws java.io.IOException
- Throws:
java.io.IOException
doSend
protected abstract void doSend(Request request)
throws java.io.IOException
- Throws:
java.io.IOException
doRecv
protected abstract void doRecv(Response response)
throws java.io.IOException
- Throws:
java.io.IOException
doSkip
protected abstract void doSkip()
throws java.io.IOException
- Throws:
java.io.IOException
sendrecv
public void sendrecv(Request request,
Response response,
long timeout)
throws java.io.IOException
- Throws:
java.io.IOException
doConnect
protected abstract void doConnect()
throws java.lang.Exception
- Throws:
java.lang.Exception
doDisconnect
protected abstract void doDisconnect(boolean hard)
throws java.io.IOException
- Throws:
java.io.IOException
connect
public void connect(long timeout)
throws TransportException
- Throws:
TransportException
disconnect
public void disconnect(boolean hard)
throws java.io.IOException
- Throws:
java.io.IOException
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
toString
public java.lang.String toString()