public bool ConnectToEchoServer() { CloseEchoClient(); Log("SetupRoutersAndProfilesIfNeeded: Restart echo services to free stale connections"); AC.StartEchoServer(EchoPort, EchoByteStream, 5); Log("ConnectToEchoServer - Extracting Local IP Address of Interface"); string localIPAddress = null; try { localIPAddress = Helpers.GetIPAddressOfTestAdapter(TestInterface.Id); } catch (Exception e) { LogError("Failed to extract the IPV4 address associated with the test adapter. " + e.Message); return(false); } Log("ConnectToEchoServer - Creating an echo client"); echoClient = new TCPEchoClient(localIPAddress, RoamingConfiguration.ServiceAPChannelAddress, EchoPort, EchoByteStream); Log("ConnectToEchoServer - Connecting echo client to EchoServer"); try { echoClient.Connect(); } catch (Exception e) { LogError("Failed to connect to the tcp server:" + RoamingConfiguration.ServiceAPChannelAddress + " - Port: " + EchoPort + " " + e.Message); return(false); } return(true); }