public class SocketHandler
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected static int |
CONNECTIONCOUNT
Number of connection attempts
|
protected static int |
SOCKETCOUNT
Number of socket attempts
|
Constructor and Description |
---|
SocketHandler(ConnectionInfo theConnInfo)
Creates a new instance of SocketHandler.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close open sockets during shutdown.
|
boolean |
connectionIsOpen()
Return true if the connection and/or socket is open and set correctly.
|
static java.lang.String |
getAddress(java.lang.String theUrl)
Return the correctly formatted address to input to a socket.
|
LicasHttpConnection |
getConnection()
Get the web-based connection.
|
static SocketHandler |
getSocketHandler(ConnectionInfo connInfo)
Retrieve an existing socket handler to the specified address or create a
new one if one does not exist.
|
void |
releaseConnection()
Release the specified socket in the handler.
|
boolean |
socketIsOpen()
Return true if the socket is open and set correctly.
|
protected static int SOCKETCOUNT
protected static int CONNECTIONCOUNT
public SocketHandler(ConnectionInfo theConnInfo)
theConnInfo
- the connection info.public static java.lang.String getAddress(java.lang.String theUrl) throws java.lang.Exception
theUrl
- the current address format.java.lang.Exception
- any error.public static SocketHandler getSocketHandler(ConnectionInfo connInfo)
connInfo
- the connection information.public boolean socketIsOpen()
public boolean connectionIsOpen()
public void releaseConnection()
public LicasHttpConnection getConnection()
public void close()
close
in interface java.lang.AutoCloseable