public void write ( IRTMPEvent event ) { if ( ! connection . isClosed ( ) ) { final IClientStream stream = connection . getStreamByChannelId ( id ) ; if ( id > 3 && stream == null ) { log . warn ( "Non-existant stream for channel id: {}, session: {} discarding: {}" , id , connection . getSessionId ( ) , event ) ; } // if the stream is non-existant, the event will go out with stream id == 0 final Number streamId = ( stream == null ) ? 0 : stream . getStreamId ( ) ; write ( event , streamId ) ; } else { log . debug ( "Connection {} is closed, cannot write to channel: {}" , connection . getSessionId ( ) , id ) ; } }
Writes packet from event data to RTMP connection .