public void ProcessSend(SocketAsyncEventArgs e) { UserToken token = e.UserToken as UserToken; if (e.SocketError != SocketError.Success) { ClientClose(token, e.SocketError.ToString()); } else { //消息发送成功,回调成功 token.Writed(); } }
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); } } }