Class TcpPortTest
- java.lang.Object
-
- com.dkfqs.measuringagent.javascript.executor.TcpPortTest
-
public class TcpPortTest extends java.lang.ObjectTest the connection to a TCP server port.- See Also:
TcpPortTestWrapper
-
-
Constructor Summary
Constructors Constructor Description TcpPortTest(java.lang.String host, int port)Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ArrayList<java.lang.String>getConnectLog()Get the connect log.longgetConnectTime()Get the TCP connect time in milliseconds.voidsetConnectTimeoutMillis(int connectTimeoutMillis)Set the TCP connect timeout in milliseconds.voidsetLocalOutboundAddress(java.lang.String localOutboundAddress)Set the local outbound address.booleantestConnection()Test the TCP connection.
-
-
-
Method Detail
-
setConnectTimeoutMillis
public void setConnectTimeoutMillis(int connectTimeoutMillis)
Set the TCP connect timeout in milliseconds.- Parameters:
connectTimeoutMillis- the TCP connect timeout in milliseconds
-
setLocalOutboundAddress
public void setLocalOutboundAddress(java.lang.String localOutboundAddress) throws java.net.UnknownHostExceptionSet the local outbound address.- Parameters:
localOutboundAddress- the local outbound address- Throws:
java.net.UnknownHostException- if the local outbound address is invalid
-
testConnection
public boolean testConnection()
Test the TCP connection.- Returns:
- true if the TCP connection was established and then closed, or false if connecting to the server has failed.
-
getConnectLog
public java.util.ArrayList<java.lang.String> getConnectLog()
Get the connect log.- Returns:
- the connect log
-
getConnectTime
public long getConnectTime()
Get the TCP connect time in milliseconds.- Returns:
- the TCP connect time in milliseconds, or -1 if no such data is available
-
-