use of org.evosuite.runtime.vnet.EndPointInfo in project evosuite by EvoSuite.
the class NetworkHandling method openRemoteTcpServer.
/**
* Create a one-time listener on remote address/port
* @param remoteServer
* @return
*/
public static boolean openRemoteTcpServer(EvoSuiteRemoteAddress remoteServer) {
if (remoteServer == null) {
return false;
}
RemoteTcpServer server = new RemoteTcpServer(new EndPointInfo(remoteServer.getHost(), remoteServer.getPort(), VirtualNetwork.ConnectionType.TCP));
VirtualNetwork.getInstance().addRemoteTcpServer(server);
return true;
}
use of org.evosuite.runtime.vnet.EndPointInfo in project evosuite by EvoSuite.
the class EvoSuiteSocket method doConnect.
protected synchronized void doConnect(InetAddress address, int port, int timeout) throws IOException {
EndPointInfo remoteTarget = new EndPointInfo(address.getHostAddress(), port, ConnectionType.TCP);
InetAddress localHost = (InetAddress) getOption(SocketOptions.SO_BINDADDR);
EndPointInfo localOrigin = new EndPointInfo(localHost.getHostAddress(), localport, ConnectionType.TCP);
this.openedConnection = VirtualNetwork.getInstance().connectToRemoteAddress(localOrigin, remoteTarget);
this.setRemoteAddress(address);
this.setRemotePort(port);
}
Aggregations