Example #1
0
 /// <summary>
 /// SessionClosed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void SessionClosed(object sender, Mina.Core.Session.IoSessionEventArgs e)
 {
     ScreenOutput("Disconnected from " + e.Session.RemoteEndPoint);
     lock (_lockObject)
     {
         Sessions.Remove(e.Session);
     }
 }
Example #2
0
 /// <summary>
 /// SessionCreated
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void SessionCreated(object sender, Mina.Core.Session.IoSessionEventArgs e)
 {
     ScreenOutput("Connected to " + e.Session.RemoteEndPoint);
     lock (_lockObject)
     {
         Sessions.Add(e.Session);
     }
 }
Example #3
0
 private void Connector_SessionOpened(object sender, Mina.Core.Session.IoSessionEventArgs e)
 {
     session = e.Session;
     State   = ConnectingState.Connected;
 }
Example #4
0
 private void OnSessionDestroyed(Object sender, IoSessionEventArgs e)
 {
     AsyncSocketSession s = e.Session as AsyncSocketSession;
     if (s != null && _readWritePool != null)
     {
         _readWritePool.Push(s.ReadBuffer);
         _readWritePool.Push(s.WriteBuffer);
     }
 }
 /// <summary>
 /// HandeleSessionClosed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void HandeleSessionClosed(Object sender, IoSessionEventArgs e)
 {
     CallDUpdateText(String.Format("SessionClosed {0}",e.Session.RemoteEndPoint.ToString()));
 }
        private void OnSessionDestroyed(Object sender, IoSessionEventArgs e)
        {
            AsyncSocketSession s = e.Session as AsyncSocketSession;
            if (s != null && _readWritePool != null)
            {
                // clear the buffer and reset its count to original capacity if changed
                s.ReadBuffer.Clear();
                s.ReadBuffer.SetBuffer();
                _readWritePool.Push(s.ReadBuffer);

                s.WriteBuffer.Clear();
                s.WriteBuffer.SetBuffer();
                _readWritePool.Push(s.WriteBuffer);
            }
        }