Exemple #1
0
        public void ReplyPublish()
        {
            var sendData    = new MemoryStream();
            var streamBegin = new StreamBegin()
            {
                ID = 1
            }.Serialize();

            double param1 = 0;
            object param2 = null;

            AMFObject param3 = new AMFObject();

            param3.SetProperty("level", "status", AMF0Types.String);
            param3.SetProperty("code", "NetStream.Publish.Start", AMF0Types.String);
            param3.SetProperty("description", "jtv_ASDF", AMF0Types.String);
            param3.SetProperty("client", (double)1234, AMF0Types.Number);

            var properties = new List <AMFProperty>();

            properties.Add(new AMFProperty("", param1, AMF0Types.Number));
            properties.Add(new AMFProperty("", param2, AMF0Types.Null));

            var reply = new AMFCall("onStatus", properties);

            sendData.Write(streamBegin, 0, streamBegin.Length);

            var resultSer = reply.Serialize();

            sendData.Write(resultSer, 0, resultSer.Length);

            resultSer = param3.Serialize();
            sendData.Write(resultSer, 0, resultSer.Length);

            Send(sendData.ToArray());
        }
Exemple #2
0
        public void ReplyPublish()
        {
            var sendData = new MemoryStream();
            var streamBegin = new StreamBegin() { ID = 1 }.Serialize();

            double param1 = 0;
            object param2 = null;

            AMFObject param3 = new AMFObject();

            param3.SetProperty("level", "status", AMF0Types.String);
            param3.SetProperty("code", "NetStream.Publish.Start", AMF0Types.String);
            param3.SetProperty("description", "jtv_ASDF", AMF0Types.String);
            param3.SetProperty("client", (double)1234, AMF0Types.Number);

            var properties = new List<AMFProperty>();

            properties.Add(new AMFProperty("", param1, AMF0Types.Number));
            properties.Add(new AMFProperty("", param2, AMF0Types.Null));

            var reply = new AMFCall("onStatus", properties);

            sendData.Write(streamBegin, 0, streamBegin.Length);

            var resultSer = reply.Serialize();
            sendData.Write(resultSer, 0, resultSer.Length);

            resultSer = param3.Serialize();
            sendData.Write(resultSer, 0, resultSer.Length);

            Send(sendData.ToArray());
        }