예제 #1
0
        public void ProcessSend(SocketAsyncEventArgs e)
        {
            UserToken token = e.UserToken as UserToken;

            if (e.SocketError != SocketError.Success)
            {
                ClientClose(token, e.SocketError.ToString());
            }
            else
            {
                //消息发送成功,回调成功
                token.Writed();
            }
        }
예제 #2
0
        public void ProcessSend(SocketAsyncEventArgs e)
        {
            UserToken token = e.UserToken as UserToken;

            if (e.SocketError != SocketError.Success)
            {
                ClientClose(token, e.SocketError.ToString());
            }
            else
            {
                if (token.CheckWriteQueue())
                {
                    //消息发送成功,回调成功
                    token.Writed();
                }
                else
                {
                    token.Close();
                    pool.Push(token);
                }
            }
        }