コード例 #1
0
		public Varint32Frame copy()
		{
			Varint32Frame fd = new Varint32Frame(1);
			fd.end = end;
			if (payload != null)
			{
				fd.payload = payload.Copy();
			}
			return fd;
		}
コード例 #2
0
        public Varint32Frame copy()
        {
            Varint32Frame fd = new Varint32Frame(1);

            fd.end = end;
            if (payload != null)
            {
                fd.payload = payload.Copy();
            }
            return(fd);
        }
コード例 #3
0
		public override  void OnOpen(USocket us)
		{
			Console.WriteLine ("连接建立");
            AuthRequest request = new AuthRequest();
            request.loginid = "lkjlkj;sdf你好";
            request.serverid = 1;
            MemoryStream  stream = new MemoryStream();
            ProtoBuf.Serializer.Serialize<AuthRequest>(stream, request);

            Varint32Frame f = new Varint32Frame(512);
            f.PutShort(6);
            f.PutBytes(stream.ToArray());
            f.End();
			us.Send (f);
		}
コード例 #4
0
ファイル: TestListner.cs プロジェクト: zhanghuiyu/cocosocket
        public override void OnOpen(USocket us)
        {
            Console.WriteLine("连接建立");
            AuthRequest request = new AuthRequest();

            request.loginid  = "lkjlkj;sdf你好";
            request.serverid = 1;
            MemoryStream stream = new MemoryStream();

            ProtoBuf.Serializer.Serialize <AuthRequest>(stream, request);

            Varint32Frame f = new Varint32Frame(512);

            f.PutShort(6);
            f.PutBytes(stream.ToArray());
            f.End();
            us.Send(f);
        }