protected void AddNewXmppConnection(IXmppConnection xmppConnection) { if (xmppConnection == null) { throw new ArgumentNullException("xmppConnection"); } try { locker.EnterWriteLock(); connections.Add(xmppConnection.Id, xmppConnection); xmppConnection.Closed += XmppConnectionClosed; } finally { locker.ExitWriteLock(); } var handler = OpenXmppConnection; if (handler != null) { handler(this, new XmppConnectionOpenEventArgs(xmppConnection)); } xmppConnection.BeginReceive(); }
private void NewConnection(IXmppConnection connection) { try { connection.BeginReceive(handlerManager); } catch { connection.Close(); throw; } }
protected void AddNewXmppConnection(IXmppConnection xmppConnection) { if (xmppConnection == null) { throw new ArgumentNullException("xmppConnection"); } connections.TryAdd(xmppConnection.Id, xmppConnection); xmppConnection.Closed += XmppConnectionClosed; OpenXmppConnection(this, new XmppConnectionOpenEventArgs(xmppConnection)); xmppConnection.BeginReceive(); }
protected void AddNewXmppConnection(IXmppConnection xmppConnection) { if (xmppConnection == null) throw new ArgumentNullException("xmppConnection"); try { locker.EnterWriteLock(); connections.Add(xmppConnection.Id, xmppConnection); xmppConnection.Closed += XmppConnectionClosed; } finally { locker.ExitWriteLock(); } var handler = OpenXmppConnection; if (handler != null) handler(this, new XmppConnectionOpenEventArgs(xmppConnection)); xmppConnection.BeginReceive(); }