public static void ConnectToServer(Gbl gbl, out TcpSocketEx tcp) { var client = new TcpSocketEx(gbl.RemoteIpAddress, gbl.Port); try { client.Connect(IPAddress.Parse(gbl.RemoteIpAddress), gbl.Port); tcp = client; } catch (Exception e) { tcp = null; } }
public static void ReleaseConnection(TcpSocketEx client) { client.Disconnect(false); }