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); }
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; } }; }
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; } }; }
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); }
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); }
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); }
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; } }
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; } }
public MiddleHandshake(BaseRtmfpProtocol handler) : base(handler) { }
public FlowGroup(ulong id, Peer peer, BaseRtmfpProtocol handler, Session band, FlowWriter flowWriter) : base(id, Signature, _Name, peer, handler, band, flowWriter) { }
//private FlowConnection _flowConnection; public DownloadSession(BaseRtmfpProtocol handler) : base(handler) { }
public FlowConnection(ulong id, Peer peer, BaseRtmfpProtocol handler, Session band,FlowWriter flowWriter) : base(id, Signature, _Name, peer, handler, band, flowWriter) { Writer.Critical = true; }
public FlowConnection(ulong id, Peer peer, BaseRtmfpProtocol handler, Session band, FlowWriter flowWriter) : base(id, Signature, _Name, peer, handler, band, flowWriter) { Writer.Critical = true; }
public Peer(BaseRtmfpProtocol handler) { Handler = handler; Addresses.Add(null); }