public class Connection extends SocketClient implements java.lang.AutoCloseable, PacketReceiver<SMB2Packet>
| Constructor and Description |
|---|
Connection(Config config,
TransportLayer transport,
SMBEventBus bus) |
| Modifier and Type | Method and Description |
|---|---|
Session |
authenticate(AuthenticationContext authContext)
Authenticate the user on this connection in order to start a (new) session.
|
void |
close() |
NegotiatedProtocol |
getNegotiatedProtocol()
Returns the negotiated protocol details for this connection.
|
void |
handle(SMB2Packet packet) |
void |
handleError(java.lang.Throwable t) |
protected void |
onConnect()
On connection establishment, also initializes the transport via
BaseTransport.init(java.io.InputStream, java.io.OutputStream). |
<T extends SMB2Packet> |
send(SMB2Packet packet) |
connect, connect, connect, connect, connect, connect, disconnect, getInputStream, getOutputStream, getRemoteAddress, getRemoteHostname, getRemotePort, getSocket, getSoTimeout, isConnected, setSocketFactory, setSoTimeoutpublic Connection(Config config, TransportLayer transport, SMBEventBus bus)
protected void onConnect()
throws java.io.IOException
BaseTransport.init(java.io.InputStream, java.io.OutputStream).onConnect in class SocketClientjava.io.IOExceptionpublic void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exceptionpublic Session authenticate(AuthenticationContext authContext)
public <T extends SMB2Packet> java.util.concurrent.Future<T> send(SMB2Packet packet) throws TransportException
TransportExceptionpublic NegotiatedProtocol getNegotiatedProtocol()
public void handle(SMB2Packet packet) throws TransportException
handle in interface PacketReceiver<SMB2Packet>TransportExceptionpublic void handleError(java.lang.Throwable t)
handleError in interface PacketReceiver<SMB2Packet>