Package io.testproject.sdk.internal.tcp
Class SocketManager
- java.lang.Object
-
- io.testproject.sdk.internal.tcp.SocketManager
-
public final class SocketManager extends java.lang.ObjectManages the development TCP socket connection.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseSocket()Closes the TCP socket connection to the Agent.static SocketManagergetInstance()Static method to obtain a singleton instance of the class.booleanisOpen()Checks whether the socket is open or closed.voidopenSocket(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 AgentConnectExceptionOpens 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.
-
-