// using System;
// using System.Collections.Concurrent;
// using System.Collections.Generic;
// using System.Linq;
// using System.Net;
// using System.Net.Sockets;
// using MrWu.Debug;
// using Sodao.FastSocket.Server;
// using Sodao.FastSocket.Server.Messaging;
// using Sodao.FastSocket.SocketBase;
//
// namespace Server.Net
// {
//     public sealed class TService : AbsSocketService<ThriftMessage>
//     {
//         /// <summary>
//         /// 链接成功事件
//         /// </summary>
//         public event Action<IConnection> OnConnectedEvt;
//
//         /// <summary>
//         /// 收到包事件
//         /// </summary>
//         public event Action<IConnection, byte[]> OnReceivedEvt;
//
//         /// <summary>
//         /// 断开连接事件
//         /// </summary>
//         public event Action<IConnection> OnDisconnectedEvt;
//
//         /// <summary>
//         /// 发送错误事件
//         /// </summary>
//         public event Action<IConnection, Exception> OnErrorEvt;
//
//         public override void OnConnected(IConnection connection)
//         {
//             base.OnConnected(connection);
//             connection.BeginReceive();
//
//             OnConnectedEvt?.Invoke(connection);
//         }
//
//         public override void OnDisconnected(IConnection connection, Exception ex)
//         {
//             base.OnDisconnected(connection, ex);
//             OnDisconnectedEvt?.Invoke(connection);
//         }
//
//         public override void OnException(IConnection connection, Exception ex)
//         {
//             base.OnException(connection, ex);
//             OnErrorEvt?.Invoke(connection,ex);
//         }
//
//         public override void OnReceived(IConnection connection, ThriftMessage message)
//         {
//             base.OnReceived(connection, message);
//             OnReceivedEvt?.Invoke(connection,message.Payload);
//         }
//
//         public override void OnSendCallback(IConnection connection, Sodao.FastSocket.SocketBase.Packet packet, bool isSuccess)
//         {
//             base.OnSendCallback(connection, packet, isSuccess);
//         }
//         
//     }
// }