Inheritance: BaseProtocol
Ejemplo n.º 1
0
 public FlowStream(ulong id, string signature, Peer peer, BaseRtmfpProtocol handler, Session band,FlowWriter localFlow)
     : base(id, signature, _Name, peer, handler, band, localFlow)
 {
     if (handler.StreamsManager?.StreamsByType.ContainsKey(StreamTypes.ST_IN_NET_RTMFP)??false)
     _publisher = handler.StreamsManager.StreamsByType[StreamTypes.ST_IN_NET_RTMFP].Select(x => x.Value as InNetRtmfpStream).SingleOrDefault(x=>x.PublisherId==StreamId);
     //_publication = handler.Publications.Values.SingleOrDefault(x => x.PublisherId == _index);
 }
Ejemplo n.º 2
0
 public OutboundHandshake(BaseRtmfpProtocol handler)
     : base(new Peer(handler), Defines.RTMFP_SYMETRIC_KEY, Defines.RTMFP_SYMETRIC_KEY)
 {
     Handler     = handler;
     _certificat = Utils.GenerateRandomBytes(76);
     Buffer.BlockCopy(CertificatInit, 0, _certificat, 0, 5);
     Buffer.BlockCopy(CertificatInit, 5, _certificat, 69, 7);
     _handshakeTimeoutTimer.Elapsed += (o, args) =>
     {
         if (_handshakeTimeoutTimer.Interval >= 3000)
         {
             _handshakeTimeoutTimer.Interval = 1000;
             _certificat = Utils.GenerateRandomBytes(76);
             Buffer.BlockCopy(CertificatInit, 0, _certificat, 0, 5);
             Buffer.BlockCopy(CertificatInit, 5, _certificat, 69, 7);
             var rand = Utils.GenerateRandomBytes(16);
             _handshake = () => HandShake30(rand);
             HandShake30(rand);
         }
         else
         {
             _handshake();
             _handshakeTimeoutTimer.Interval += 1000;
         }
     };
 }
Ejemplo n.º 3
0
 public OutboundHandshake(BaseRtmfpProtocol handler)
     : base(new Peer(handler),Defines.RTMFP_SYMETRIC_KEY, Defines.RTMFP_SYMETRIC_KEY)
 {
     Handler = handler;
     _certificat = Utils.GenerateRandomBytes(76);
     Buffer.BlockCopy(CertificatInit, 0, _certificat, 0, 5);
     Buffer.BlockCopy(CertificatInit, 5, _certificat, 69, 7);
     _handshakeTimeoutTimer.Elapsed += (o, args) =>
     {
         if (_handshakeTimeoutTimer.Interval >= 3000)
         {
             _handshakeTimeoutTimer.Interval = 1000;
             _certificat = Utils.GenerateRandomBytes(76);
             Buffer.BlockCopy(CertificatInit, 0, _certificat, 0, 5);
             Buffer.BlockCopy(CertificatInit, 5, _certificat, 69, 7);
             var rand = Utils.GenerateRandomBytes(16);
             _handshake = () => HandShake30(rand);
             HandShake30(rand);
         }
         else
         {
             _handshake();
             _handshakeTimeoutTimer.Interval += 1000;
         }
     };
 }
Ejemplo n.º 4
0
 public FlowStream(ulong id, string signature, Peer peer, BaseRtmfpProtocol handler, Session band, FlowWriter localFlow)
     : base(id, signature, _Name, peer, handler, band, localFlow)
 {
     if (handler.StreamsManager?.StreamsByType.ContainsKey(StreamTypes.ST_IN_NET_RTMFP) ?? false)
     {
         _publisher = handler.StreamsManager.StreamsByType[StreamTypes.ST_IN_NET_RTMFP].Select(x => x.Value as InNetRtmfpStream).SingleOrDefault(x => x.PublisherId == StreamId);
     }
     //_publication = handler.Publications.Values.SingleOrDefault(x => x.PublisherId == _index);
 }
Ejemplo n.º 5
0
 public HandShake(BaseRtmfpProtocol handler)
     : base(new Peer(handler),Defines.RTMFP_SYMETRIC_KEY, Defines.RTMFP_SYMETRIC_KEY)
 {
     Handler = handler;
     Checked = true;
     _certificat = Utils.GenerateRandomBytes(77);
     _certificat[0] = 0x01;
     _certificat[1] = 0x0A;
     _certificat[2] = 0x41;
     _certificat[3] = 0x0E;
     Buffer.BlockCopy(CertificatInit, 0, _certificat, 68, 9);
 }
Ejemplo n.º 6
0
 public HandShake(BaseRtmfpProtocol handler)
     : base(new Peer(handler), Defines.RTMFP_SYMETRIC_KEY, Defines.RTMFP_SYMETRIC_KEY)
 {
     Handler        = handler;
     Checked        = true;
     _certificat    = Utils.GenerateRandomBytes(77);
     _certificat[0] = 0x01;
     _certificat[1] = 0x0A;
     _certificat[2] = 0x41;
     _certificat[3] = 0x0E;
     Buffer.BlockCopy(CertificatInit, 0, _certificat, 68, 9);
 }
Ejemplo n.º 7
0
 public Flow(ulong id, string signature, string name, Peer peer, BaseRtmfpProtocol handler, Session band,FlowWriter flowWriter)
 {
     Id = id;
     StreamId = signature.ToBytes().Read7BitValue(4);
     Peer = peer;
     Handler = handler;
     Band = band;
     if (flowWriter == null || flowWriter.Signature!=signature)
         Writer = new FlowWriter(signature, band, id) {Obj = name};
     else
     {
         Writer = flowWriter;
         Writer.FlowId = id;
     }
 }
Ejemplo n.º 8
0
 public Flow(ulong id, string signature, string name, Peer peer, BaseRtmfpProtocol handler, Session band, FlowWriter flowWriter)
 {
     Id       = id;
     StreamId = signature.ToBytes().Read7BitValue(4);
     Peer     = peer;
     Handler  = handler;
     Band     = band;
     if (flowWriter == null || flowWriter.Signature != signature)
     {
         Writer = new FlowWriter(signature, band, id)
         {
             Obj = name
         }
     }
     ;
     else
     {
         Writer        = flowWriter;
         Writer.FlowId = id;
     }
 }
Ejemplo n.º 9
0
 public MiddleHandshake(BaseRtmfpProtocol handler) : base(handler)
 {
 }
Ejemplo n.º 10
0
 public FlowGroup(ulong id, Peer peer, BaseRtmfpProtocol handler, Session band, FlowWriter flowWriter)
     : base(id, Signature, _Name, peer, handler, band, flowWriter)
 {
 }
Ejemplo n.º 11
0
 //private FlowConnection _flowConnection;
 public DownloadSession(BaseRtmfpProtocol handler) : base(handler)
 {
 }
Ejemplo n.º 12
0
 public FlowConnection(ulong id, Peer peer, BaseRtmfpProtocol handler, Session band,FlowWriter flowWriter)
     : base(id, Signature, _Name, peer, handler, band, flowWriter)
 {
     Writer.Critical = true;
 }
Ejemplo n.º 13
0
 public FlowConnection(ulong id, Peer peer, BaseRtmfpProtocol handler, Session band, FlowWriter flowWriter)
     : base(id, Signature, _Name, peer, handler, band, flowWriter)
 {
     Writer.Critical = true;
 }
Ejemplo n.º 14
0
 public Peer(BaseRtmfpProtocol handler)
 {
     Handler = handler;
     Addresses.Add(null);
 }
Ejemplo n.º 15
0
 public MiddleHandshake(BaseRtmfpProtocol handler) : base(handler)
 {
 }
Ejemplo n.º 16
0
 public FlowGroup(ulong id, Peer peer, BaseRtmfpProtocol handler, Session band, FlowWriter flowWriter)
     : base(id, Signature, _Name, peer, handler, band, flowWriter)
 {
 }