Ejemplo n.º 1
0
 static SocketManager()
 {
     Stream = new ZYNetRingBufferPoolV2(40960);
     client = new SocketClient();
     client.BinaryInput += new ClientBinaryInputHandler(client_BinaryInput);
     client.ErrorLogOut += new ErrorLogOutHandler(client_ErrorLogOut);
     client.MessageInput += new ClientMessageInputHandler(client_MessageInput);
 }
Ejemplo n.º 2
0
 static SocketManager()
 {
     //初始化数据包缓冲区,并设置了最大数据包尽可能的大 
     BuffListManger = new ZYNetRingBufferPoolV2(400000); 
     client=new SocketClient();
     client.DataOn += new DataOn(client_DataOn);
     client.Disconnection += new ExceptionDisconnection(client_Disconnection);
 }
Ejemplo n.º 3
0
        public ClientInfo(string host, int port, int regipport,int bindminPort,int bindMaxPort,int resCount,string mac)
        {
            ResetConnt = resCount;
            ConnUserList = new ConcurrentDictionary<string, ConClient>(); //初始化客户端列表
            ProxyList = new ConcurrentDictionary<string, ConClient>();
            Key = Guid.NewGuid().ToString();//产生唯一标示KEY
            Bufferlist = new ZYNetRingBufferPoolV2();
            UserMaskList = new ConcurrentQueue<string>();
            BindPort = new Random().Next(bindminPort, bindMaxPort);
            this.Host = host;
            this.Port = port;
            this.RegIpPort = regipport;
            this.Mac = mac;

           
        }