Example #1
0
 internal ConClient(string host, int port, int maxBuffLength)
 {
     BufferQueue        = new ZYNetRingBufferPool(maxBuffLength);
     this.Host          = host;
     this.Port          = port;
     Sock               = new SocketClient();
     Sock.ConnInput    += new ConnectionHandler(Connection);
     Sock.BinaryInput  += new ClientBinaryInputHandler(DataIn);
     Sock.MessageInput += new ClientMessageInputHandler(ExpInput);
 }
Example #2
0
 public ZYNetClient(ushort minport, ushort maxport, int bufferPoolLength)
 {
     BufferPoolLength           = bufferPoolLength;
     BufferFormat.ObjFormatType = BuffFormatType.protobuf;
     ReadBytes.ObjFormatType    = BuffFormatType.protobuf;
     ConnUserList = new ConcurrentDictionary <long, SessionObj>();
     UserMaskList = new ConcurrentQueue <long>();
     BufferQueue  = new ZYNetRingBufferPool(BufferPoolLength);
     BindPort     = new Random().Next(minport, maxport);
     ResetConnt   = 1;
     Group        = 0;
 }
Example #3
0
 public ZYNetClient()
 {
     BufferPoolLength           = 1024 * 1024 * 2;
     BufferFormat.ObjFormatType = BuffFormatType.protobuf;
     ReadBytes.ObjFormatType    = BuffFormatType.protobuf;
     ConnUserList = new ConcurrentDictionary <long, SessionObj>();
     UserMaskList = new ConcurrentQueue <long>();
     BufferQueue  = new ZYNetRingBufferPool(BufferPoolLength);
     BindPort     = new Random().Next(1000, 60000);
     ResetConnt   = 1;
     Group        = 0;
 }