Class BaseRTMPTConnection

  • All Implemented Interfaces:
    org.red5.server.api.event.IEventDispatcher, org.red5.server.api.event.IEventHandler, org.red5.server.api.event.IEventListener, org.red5.server.api.IAttributeStore, org.red5.server.api.ICastingAttributeStore, org.red5.server.api.IConnection, org.red5.server.api.ICoreObject, org.red5.server.api.service.IServiceCapableConnection, org.red5.server.api.stream.IStreamCapableConnection, org.red5.server.jmx.mxbeans.AttributeStoreMXBean, org.red5.server.net.rtmp.IReceivedMessageTaskQueueListener
    Direct Known Subclasses:
    RTMPTClientConnection

    public abstract class BaseRTMPTConnection
    extends org.red5.server.net.rtmp.RTMPConnection
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.red5.server.api.IConnection

        org.red5.server.api.IConnection.Duty, org.red5.server.api.IConnection.Encoding, org.red5.server.api.IConnection.Type
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected String clientSessionId
      Clients session id, used to override the BaseConnection.sessionId for client implementations.
      • Fields inherited from class org.red5.server.net.rtmp.RTMPConnection

        bytesReadInterval, deadlockGuardScheduler, decoderLock, decoderState, encoderLock, executor, isDebug, isTrace, limitType, MAX_RESERVED_STREAMS, maxHandlingTimeout, maxInactivity, nextBytesRead, RTMP_CONN_MANAGER, RTMP_ENCRYPTED, RTMP_ENCRYPTED_BLOWFISH, RTMP_ENCRYPTED_UNK, RTMP_ENCRYPTED_XTEA, RTMP_HANDLER, RTMP_HANDSHAKE, RTMP_NON_ENCRYPTED, RTMP_SESSION_ID, RTMPE_CIPHER_IN, RTMPE_CIPHER_OUT, running, scheduler, state
      • Fields inherited from class org.red5.server.BaseConnection

        basicScopes, client, connectionListeners, droppedMessages, duty, host, params, path, readMessages, remoteAddress, remoteAddresses, remotePort, scope, sessionId, type, writtenMessages
      • Fields inherited from class org.red5.server.AttributeStore

        attributes
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      List<?> decode​(org.apache.mina.core.buffer.IoBuffer data)
      Decode data sent by the client.
      protected org.apache.mina.core.buffer.IoBuffer foldPendingMessages​(int targetSize)  
      long getPendingMessages()
      abstract org.apache.mina.core.buffer.IoBuffer getPendingMessages​(int targetSize)
      Return any pending messages up to a given size.
      long getReadBytes()
      String getSessionId()  
      long getWrittenBytes()
      boolean isClosing()
      Getter for property 'closing'.
      void realClose()
      Real close
      void setDecoder​(org.red5.server.net.rtmp.codec.RTMPProtocolDecoder decoder)  
      void setEncoder​(org.red5.server.net.rtmp.codec.RTMPProtocolEncoder encoder)  
      void setHandler​(org.red5.server.net.rtmp.IRTMPHandler handler)  
      void setSessionId​(String sessionId)  
      void write​(org.red5.server.net.rtmp.message.Packet packet)
      Send RTMP packet down the connection.
      void writeRaw​(org.apache.mina.core.buffer.IoBuffer packet)
      Send raw data down the connection.
      • Methods inherited from class org.red5.server.net.rtmp.RTMPConnection

        addClientStream, closeChannel, connect, createOutputStream, createStreamName, currentQueueSize, deleteStreamById, dispatchEvent, getChannel, getChannelIdForStreamId, getChannelsConcurrencyLevel, getChannelsInitalCapacity, getClientBytesRead, getDeadlockGuardScheduler, getDecoderLock, getDecoderState, getEncoderLock, getEncoding, getExecutor, getHandler, getId, getIoSession, getLastPingSentAndLastPongReceivedInterval, getLastPingTime, getMaxHandlingTimeout, getNextAvailableChannelId, getPendingCall, getPendingCallsConcurrencyLevel, getPendingCallsInitalCapacity, getPendingVideoMessages, getProtocol, getReservedStreamsConcurrencyLevel, getReservedStreamsInitalCapacity, getScheduler, getState, getStateCode, getStreamByChannelId, getStreamById, getStreamIdForChannelId, getStreams, getStreamsConcurrencyLevel, getStreamsInitalCapacity, getStreamsMap, getTimer, getTransactionId, getUsedStreamCount, handleMessageReceived, invoke, invoke, invoke, invoke, invoke, invoke, isChannelUsed, isDisconnected, isIdle, isValidStreamId, messageDropped, messageReceived, messageSent, messageTypeToName, newBroadcastStream, newPlaylistSubscriberStream, newSingleItemSubscriberStream, notify, notify, notify, notify, onInactive, onTaskAdded, onTaskRemoved, open, ping, ping, pingReceived, receivedBytesRead, registerDeferredResult, registerPendingCall, rememberStreamBufferDuration, removeClientStream, reserveStreamId, reserveStreamId, retrievePendingCall, sendPendingServiceCallsCloseError, sendSharedObjectMessage, setBandwidth, setChannelsConcurrencyLevel, setChannelsInitalCapacity, setDeadlockGuardScheduler, setExecutor, setExecutorQueueSizeToDropAudioPackets, setId, setMaxHandlingTimeout, setMaxHandshakeTimeout, setMaxInactivity, setPendingCallsConcurrencyLevel, setPendingCallsInitalCapacity, setPingInterval, setReservedStreamsConcurrencyLevel, setReservedStreamsInitalCapacity, setScheduler, setStateCode, setStreamsConcurrencyLevel, setStreamsInitalCapacity, setup, startWaitForHandshake, status, status, toString, unregisterDeferredResult, unreserveStreamId, updateBytesRead, writingMessage
      • Methods inherited from class org.red5.server.BaseConnection

        addListener, connect, equals, getBasicScopes, getClient, getConnectParams, getDroppedMessages, getDuty, getHost, getLock, getPath, getReadMessages, getRemoteAddress, getRemoteAddresses, getRemotePort, getScope, getStreamId, getType, getWrittenMessages, handleEvent, hashCode, initialize, isClosed, isConnected, isReaderIdle, isWriterIdle, notifyEvent, registerBasicScope, registerBasicScope, removeListener, setClient, setDuty, setStreamId, unregisterBasicScope
      • Methods inherited from class org.red5.server.AttributeStore

        filterNull, from, getAttribute, getAttribute, getAttribute, getAttributeNames, getAttributes, getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute, hasAttribute, hasAttribute, removeAttribute, removeAttribute, removeAttributes, setAttribute, setAttribute, setAttributes, setAttributes, size
      • Methods inherited from interface org.red5.server.api.IAttributeStore

        getAttribute, getAttribute, getAttribute, getAttributeNames, getAttributes, hasAttribute, hasAttribute, removeAttribute, removeAttribute, removeAttributes, setAttribute, setAttribute, setAttributes, setAttributes, size
      • Methods inherited from interface org.red5.server.api.ICastingAttributeStore

        getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute
      • Methods inherited from interface org.red5.server.api.IConnection

        addListener, connect, getBasicScopes, getClient, getConnectParams, getDroppedMessages, getDuty, getHost, getPath, getReadMessages, getRemoteAddress, getRemoteAddresses, getRemotePort, getScope, getStreamId, getType, getWrittenMessages, initialize, isConnected, removeListener, setClient, setStreamId
      • Methods inherited from interface org.red5.server.api.event.IEventHandler

        handleEvent
      • Methods inherited from interface org.red5.server.api.event.IEventListener

        notifyEvent
    • Field Detail

      • clientSessionId

        protected String clientSessionId
        Clients session id, used to override the BaseConnection.sessionId for client implementations.
    • Constructor Detail

      • BaseRTMPTConnection

        public BaseRTMPTConnection​(String type)
    • Method Detail

      • getPendingMessages

        public abstract org.apache.mina.core.buffer.IoBuffer getPendingMessages​(int targetSize)
        Return any pending messages up to a given size.
        Parameters:
        targetSize - the size the resulting buffer should have
        Returns:
        a buffer containing the data to send or null if no messages are pending
      • close

        public void close()
        Specified by:
        close in interface org.red5.server.api.IConnection
        Overrides:
        close in class org.red5.server.net.rtmp.RTMPConnection
      • isClosing

        public boolean isClosing()
        Getter for property 'closing'.
        Returns:
        Value for property 'closing'.
      • realClose

        public void realClose()
        Real close
      • writeRaw

        public void writeRaw​(org.apache.mina.core.buffer.IoBuffer packet)
        Send raw data down the connection.
        Specified by:
        writeRaw in class org.red5.server.net.rtmp.RTMPConnection
        Parameters:
        packet - the buffer containing the raw data
      • getReadBytes

        public long getReadBytes()
        Specified by:
        getReadBytes in interface org.red5.server.api.IConnection
        Overrides:
        getReadBytes in class org.red5.server.net.rtmp.RTMPConnection
      • getWrittenBytes

        public long getWrittenBytes()
        Specified by:
        getWrittenBytes in interface org.red5.server.api.IConnection
        Overrides:
        getWrittenBytes in class org.red5.server.net.rtmp.RTMPConnection
      • getPendingMessages

        public long getPendingMessages()
        Specified by:
        getPendingMessages in interface org.red5.server.api.IConnection
        Overrides:
        getPendingMessages in class org.red5.server.BaseConnection
      • setSessionId

        public void setSessionId​(String sessionId)
      • getSessionId

        public String getSessionId()
        Specified by:
        getSessionId in interface org.red5.server.api.IConnection
        Overrides:
        getSessionId in class org.red5.server.BaseConnection
      • decode

        public List<?> decode​(org.apache.mina.core.buffer.IoBuffer data)
        Decode data sent by the client.
        Parameters:
        data - the data to decode
        Returns:
        a list of decoded objects
      • write

        public void write​(org.red5.server.net.rtmp.message.Packet packet)
        Send RTMP packet down the connection.
        Specified by:
        write in class org.red5.server.net.rtmp.RTMPConnection
        Parameters:
        packet - the packet to send
      • foldPendingMessages

        protected org.apache.mina.core.buffer.IoBuffer foldPendingMessages​(int targetSize)
      • setHandler

        public void setHandler​(org.red5.server.net.rtmp.IRTMPHandler handler)
        Overrides:
        setHandler in class org.red5.server.net.rtmp.RTMPConnection
      • setDecoder

        public void setDecoder​(org.red5.server.net.rtmp.codec.RTMPProtocolDecoder decoder)
      • setEncoder

        public void setEncoder​(org.red5.server.net.rtmp.codec.RTMPProtocolEncoder encoder)