Ejemplo n.º 1
0
        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;
     }
 }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        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();
        }