public static SenderConnection CreateWithoutEndpoint() { CurrentConnection = new SenderConnection(); CurrentConnection.ConnectionSocket = null; return CurrentConnection; }
public static SenderConnection ConnectTo(string hostName, int port, string connectionPassword) { if (CurrentConnection != null) throw new NotSupportedException("There is already a client connection available."); SenderConnection c = new SenderConnection(); c.ConnectionPassword = connectionPassword; c.Connect(hostName, port); if (!c.DoInitialHandshake()) return null; CurrentConnection = c; return c; }