public override bool SignalInputData(int recAmount) { if (_enqueueForDelete) { return(true); } bool result; if (_handshakeCompleted) { result = ProcessBytes(InputBuffer); var decodedBytes = GetDecodedBytesCount(); if (result && (decodedBytes >= _nextReceivedBytesCountReport)) { var _bytesReadMessage = GenericMessageFactory.GetAck(decodedBytes); _nextReceivedBytesCountReport += _winAckSize; if (!SendMessage(_bytesReadMessage)) { FATAL("Unable to send\n{0}", _bytesReadMessage.ToString()); return(false); } } } else { result = PerformHandshake(InputBuffer); if (!result) { FATAL("Unable to perform handshake"); return(false); } if (_handshakeCompleted) { result = SignalInputData(recAmount); if (result && (Type == ProtocolTypes.PT_OUTBOUND_RTMP)) { result = _pProtocolHandler.OutboundConnectionEstablished((OutboundRTMPProtocol)this); } } } return(result); }
public void TrySetOutboundChunkSize(uint chunkSize) { if (_outboundChunkSize >= chunkSize) { return; } _outboundChunkSize = chunkSize; SendMessage(GenericMessageFactory.GetChunkSize(_outboundChunkSize)); #if PARALLEL _streams.Where(x => x != null && x.Type.TagKindOf(StreamTypes.ST_OUT_NET_RTMP)).Cast <BaseOutNetRTMPStream>().AsParallel().ForAll( y => y.ChunkSize = _outboundChunkSize); #else foreach ( var baseStream in _streams.Where(x => x != null && x.Type.TagKindOf(ST_OUT_NET_RTMP)) .Cast <BaseOutNetRTMPStream>()) { baseStream.ChunkSize = _outboundChunkSize; } #endif }
public static AmfMessage GetSharedObject(uint channelId, uint streamId, double timeStamp, bool isAbsolute, string name, uint version, bool persistent) { AmfMessage amfMessage; amfMessage.Header = GenericMessageFactory.VH(HeaderType.HT_FULL, channelId, (uint)timeStamp, 0, Defines.RM_HEADER_MESSAGETYPE_SHAREDOBJECT, streamId, isAbsolute); amfMessage.Body = Variant.GetMap(new VariantMapHelper { { Defines.RM_SHAREDOBJECT, Variant.GetMap(new VariantMapHelper { { Defines.RM_SHAREDOBJECT_NAME, name }, { Defines.RM_SHAREDOBJECT_VERSION, version }, { Defines.RM_SHAREDOBJECT_PERSISTENCE, persistent } }) } }); return(amfMessage); }