コード例 #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);
     }
 }
コード例 #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);
     }
 }
コード例 #3
0
ファイル: Networking.cs プロジェクト: o0oteam/Ph-m
 private void Connector_SessionOpened(object sender, Mina.Core.Session.IoSessionEventArgs e)
 {
     session = e.Session;
     State   = ConnectingState.Connected;
 }
コード例 #4
0
ファイル: AsyncSocketAcceptor.cs プロジェクト: zesus19/c5.v1
 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);
     }
 }
コード例 #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()));
 }
コード例 #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);
            }
        }