Package io.testproject.sdk.internal.tcp
Class SocketManager
- java.lang.Object
-
- io.testproject.sdk.internal.tcp.SocketManager
-
public final class SocketManager extends java.lang.Object
Manages the development TCP socket connection.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeSocket()
Closes the TCP socket connection to the Agent.static SocketManager
getInstance()
Static method to obtain a singleton instance of the class.boolean
isOpen()
Checks whether the socket is open or closed.void
openSocket(java.lang.String host, int port)
Opens a TCP socket connection to the Agent using provided host and port.
-
-
-
Method Detail
-
getInstance
public static SocketManager getInstance()
Static method to obtain a singleton instance of the class.- Returns:
- SocketManager instance.
-
closeSocket
public void closeSocket()
Closes the TCP socket connection to the Agent.
-
openSocket
public void openSocket(java.lang.String host, int port) throws AgentConnectException
Opens a TCP socket connection to the Agent using provided host and port. Does effectively nothing if already connected.- Parameters:
host
- Host to connect.port
- Port to connect.- Throws:
AgentConnectException
- When connection fails.
-
isOpen
public boolean isOpen()
Checks whether the socket is open or closed.- Returns:
- True if open, otherwise False.
-
-