public class TcpipSMBNetworkSession extends NetworkSession
| Constructor and Description |
|---|
TcpipSMBNetworkSession()
Default constructor
|
TcpipSMBNetworkSession(int tmo)
Class constructor
|
TcpipSMBNetworkSession(int tmo,
int port)
Class constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
Close()
Close the network session
|
boolean |
hasData()
Check if there is data available on this network session
|
boolean |
isConnected()
Determine if the session is connected to a remote host
|
void |
Open(String toName,
String fromName,
String toAddr)
Open a connection to a remote host
|
int |
Receive(byte[] buf)
Receive a data packet from the remote host.
|
boolean |
Send(byte[] data,
int siz)
Send a data packet to the remote host.
|
static void |
setDebug(boolean dbg)
Enable/disable session debugging output
|
void |
setTimeout(int tmo)
Set the socket timeout
|
getDefaultTimeout, getProtocolName, getTimeout, setDefaultTimeoutpublic TcpipSMBNetworkSession()
public TcpipSMBNetworkSession(int tmo)
tmo - Socket timeout, in millisecondspublic TcpipSMBNetworkSession(int tmo,
int port)
tmo - Socket timeout, in millisecondsport - Session port to connect to on the serverpublic void Open(String toName, String fromName, String toAddr) throws IOException, UnknownHostException
Open in class NetworkSessiontoName - Host name/address being calledfromName - Local host name/addresstoAddr - Optional addressIOExceptionUnknownHostExceptionpublic boolean isConnected()
isConnected in class NetworkSessionpublic final boolean hasData()
throws IOException
hasData in class NetworkSessionIOExceptionpublic int Receive(byte[] buf)
throws IOException
Receive in class NetworkSessionbuf - Byte buffer to receive the data into.IOException - I/O error occurred.public boolean Send(byte[] data,
int siz)
throws IOException
Send in class NetworkSessiondata - Byte array containing the data to be sent.siz - Length of the data to send.IOException - I/O error occurred.public void Close()
throws IOException
Close in class NetworkSessionIOException - I/O error occurredpublic void setTimeout(int tmo)
setTimeout in class NetworkSessiontmo - intpublic static void setDebug(boolean dbg)
dbg - true to enable debugging, else falseCopyright © 2005–2020 Alfresco Software. All rights reserved.