private NetworkServer()
        {
            server = new TcpPackServer();

            server.OnPrepareListen += new TcpServerEvent.OnPrepareListenEventHandler(this.OnPrepareListen);
            server.OnAccept        += new TcpServerEvent.OnAcceptEventHandler(this.OnAccept);
            server.OnSend          += new TcpServerEvent.OnSendEventHandler(this.OnSend);
            server.OnReceive       += new TcpServerEvent.OnReceiveEventHandler(this.OnReceive);
            server.OnClose         += new TcpServerEvent.OnCloseEventHandler(this.OnClose);
            server.OnShutdown      += new TcpServerEvent.OnShutdownEventHandler(this.OnShutdown);

            // 设置包头标识,与对端设置保证一致性
            server.PackHeaderFlag = this.PackHeaderFlag;
            // 设置最大封包大小
            server.MaxPackSize = this.MaxPackSize;
        }