public abstract class SocketConnection
- Object
- SocketConnection
Known subtypesMCPLoopbackSocketTransport.Connection
Callback for establishment of a socket connection. Notice this callback
is always invoked on a new separate thread to allow uninterrupted IO.
Constructors
public SocketConnection() | |
public SocketConnection(int connectTimeout) | Creates a socket connection, setting the connect timeout. |
Methods
public abstract void connectionError(int errorCode, String message) | Invoked in case of an error in the socket connection, this method is invoked off the EDT |
public abstract void connectionEstablished(InputStream is, OutputStream os) | Invoked when a socket connection is established, this method is invoked off the EDT |
public boolean isConnected() | Returns true if this connection is currently active |
public int getConnectTimeout() | Gets the connect timeout. |
public void setConnectTimeout(int connectTimeout) | Sets the connect timeout. |
Inherited methods
Constructor details
SocketConnection
public SocketConnection()SocketConnection
public SocketConnection(int connectTimeout)Creates a socket connection, setting the connect timeout. Timeout of 0 is infinite.
Parameters
connectTimeoutint- The connect timeout. 0 for infinite.
Method details
connectionError
public abstract void connectionError(int errorCode, String message)Invoked in case of an error in the socket connection, this method is invoked off the EDT
Parameters
errorCodeint- the error code
messageString- error message if applicable
connectionEstablished
public abstract void connectionEstablished(InputStream is, OutputStream os)Invoked when a socket connection is established, this method is invoked off the EDT
Parameters
isInputStream- input stream for the socket
osOutputStream- output stream for the socket
isConnected
public boolean isConnected()Returns true if this connection is currently active
Returns
true if connected
getConnectTimeout
public int getConnectTimeout()Gets the connect timeout.
Returns
The connect timeout. 0 for infinite.
setConnectTimeout
public void setConnectTimeout(int connectTimeout)Sets the connect timeout.
Parameters
connectTimeoutint- The connect timeout. 0 for infinite timeout.