Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 3
0
 private void Connector_SessionOpened(object sender, Mina.Core.Session.IoSessionEventArgs e)
 {
     session = e.Session;
     State   = ConnectingState.Connected;
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 5
0
 /// <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()));
 }
Exemplo n.º 6
0
        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);
            }
        }