コード例 #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();
        }
コード例 #2
0
 private void NewConnection(IXmppConnection connection)
 {
     try
     {
         connection.BeginReceive(handlerManager);
     }
     catch
     {
         connection.Close();
         throw;
     }
 }
コード例 #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();
        }
コード例 #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();
        }