Example #1
0
 public SprotoTcpSocket(SprotoMgr S2C, SprotoMgr C2S)
 {
     this.TcpSocket = new TcpClientSocket();
     this.TcpSocket.Register(this._OnConnect, this._OnClose, this._OnMessage, this._Log);
     this.Dispatcher = new ProtoDispatcher();
     this.Proto      = new SprotoRpc(S2C, C2S);
 }
Example #2
0
        public SprotoTcpSocket(string s2cfile, string c2sfile, bool isbinary = false)
        {
            this.TcpSocket = new TcpClientSocket();
            this.TcpSocket.Register(this._OnConnect, this._OnClose, this._OnMessage, this._Log);
            this.Dispatcher = new ProtoDispatcher();
            SprotoMgr S2C = SprotoParser.ParseFile(s2cfile);
            SprotoMgr C2S = SprotoParser.ParseFile(c2sfile);

            this.Proto = new SprotoRpc(S2C, C2S);
        }