org.red5.server.net.rtmpt

## Class BaseRTMPTConnection

- java.lang.Object
- - org.red5.server.AttributeStore
  - - org.red5.server.BaseConnection
    - - org.red5.server.net.rtmp.RTMPConnection
      - - org.red5.server.net.rtmpt.BaseRTMPTConnection

All Implemented Interfaces:
  IEventDispatcher, IEventHandler, IEventListener, IAttributeStore, ICastingAttributeStore, IConnection, ICoreObject, IServiceCapableConnection, IStreamCapableConnection, AttributeStoreMXBean

Direct Known Subclasses:
  RTMPTConnection

    public abstract class BaseRTMPTConnection
    extends RTMPConnection

### Nested Class Summary

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

`IConnection.Encoding`

### Field Summary

### Fields inherited from class org.red5.server.net.rtmp.RTMPConnection

`bytesReadInterval, clientId, limitType, nextBytesRead, RTMP_CONNECTION_KEY, RTMP_ENCRYPTED, RTMP_HANDSHAKE, RTMP_NON_ENCRYPTED, RTMPE_CIPHER_IN, RTMPE_CIPHER_OUT, state`

### Fields inherited from class org.red5.server.BaseConnection

`basicScopes, client, closed, droppedMessages, host, params, path, readMessages, remoteAddress, remoteAddresses, remotePort, scope, sessionId, type, writtenMessages`

### Fields inherited from class org.red5.server.AttributeStore

`attributes`

### Fields inherited from interface org.red5.server.api.IConnection

`PERSISTENT, POLLING, TRANSIENT`

### Constructor Summary

Constructors
Constructor and Description
`BaseRTMPTConnection(String type)`

### Method Summary

Methods
`void` `close()` Closes connection
`List<?>` `decode(IoBuffer data)` Decode data sent by the client.
`protected IoBuffer` `foldPendingMessages(int targetSize)`
`long` `getPendingMessages()` Total number of messages that are pending to be sent to the connection.
`abstract IoBuffer` `getPendingMessages(int targetSize)` Return any pending messages up to a given size.
`long` `getReadBytes()` Total number of bytes read from the connection.
`long` `getWrittenBytes()` Total number of bytes written to the connection.
`boolean` `isClosing()` Getter for property 'closing'.
`void` `realClose()` Real close
`void` `setDecoder(RTMPProtocolDecoder decoder)`
`void` `setEncoder(RTMPProtocolEncoder encoder)`
`void` `setHandler(IRTMPHandler handler)`
`void` `write(Packet packet)` Send RTMP packet down the connection.
`void` `writeRaw(IoBuffer packet)` Send raw data down the connection.

### Methods inherited from class org.red5.server.net.rtmp.RTMPConnection

`addClientStream, closeChannel, connect, createOutputStream, createStreamName, deleteStreamById, equals, getChannel, getClientBytesRead, getEncoding, getId, getInvokeId, getLastPingTime, getNextAvailableChannelId, getPendingCall, getPendingVideoMessages, getState, getStateCode, getStreamByChannelId, getStreamById, getStreamIdForChannel, getStreams, getUsedStreamCount, hashCode, invoke, invoke, invoke, invoke, invoke, invoke, isChannelUsed, isValidStreamId, messageDropped, messageReceived, messageSent, newBroadcastStream, newPlaylistSubscriberStream, newSingleItemSubscriberStream, notify, notify, notify, notify, onInactive, ping, ping, pingReceived, receivedBytesRead, registerDeferredResult, registerPendingCall, rememberStreamBufferDuration, removeClientStream, reserveStreamId, reserveStreamId, retrievePendingCall, sendPendingServiceCallsCloseError, setBandwidth, setId, setMaxHandshakeTimeout, setMaxInactivity, setPingInterval, setSchedulingService, setState, setStateCode, setup, startRoundTripMeasurement, startWaitForHandshake, toString, unregisterDeferredResult, unreserveStreamId, updateBytesRead, writingMessage`

### Methods inherited from class org.red5.server.BaseConnection

`connect, dispatchEvent, getBasicScopes, getClient, getConnectParams, getDroppedMessages, getHost, getLock, getNextClientId, getPath, getReadMessages, getRemoteAddress, getRemoteAddresses, getRemotePort, getScope, getSessionId, getType, getWrittenMessages, handleEvent, initialize, isConnected, notifyEvent, registerBasicScope, unregisterBasicScope`

### Methods inherited from class org.red5.server.AttributeStore

`filterNull, from, getAttribute, getAttribute, getAttributeNames, getAttributes, getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.red5.server.api.IConnection

`connect, getBasicScopes, getClient, getConnectParams, getDroppedMessages, getHost, getPath, getReadMessages, getRemoteAddress, getRemoteAddresses, getRemotePort, getScope, getSessionId, getType, getWrittenMessages, initialize, isConnected`

### Methods inherited from interface org.red5.server.api.event.IEventDispatcher

`dispatchEvent`

### Methods inherited from interface org.red5.server.api.event.IEventHandler

`handleEvent`

### Methods inherited from interface org.red5.server.api.event.IEventListener

`notifyEvent`

### 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.IAttributeStore

`getAttribute, getAttribute, getAttributeNames, getAttributes, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes`

### Constructor Detail

#### BaseRTMPTConnection

    public BaseRTMPTConnection(String type)

### Method Detail

#### getPendingMessages

    public abstract 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()

Closes connection

Specified by:
  `close` in interface `IConnection`
Overrides:
  `close` in class `RTMPConnection`

#### isClosing

    public boolean isClosing()

Getter for property 'closing'.

Returns:
  Value for property 'closing'.

#### realClose

    public void realClose()

Real close

#### writeRaw

    public void writeRaw(IoBuffer packet)

Send raw data down the connection.

Specified by:
  `writeRaw` in class `RTMPConnection`
Parameters:
  `packet` - the buffer containing the raw data

#### getReadBytes

    public long getReadBytes()

Total number of bytes read from the connection.

Specified by:
  `getReadBytes` in interface `IConnection`
Overrides:
  `getReadBytes` in class `RTMPConnection`
Returns:
  bytes read

#### getWrittenBytes

    public long getWrittenBytes()

Total number of bytes written to the connection.

Specified by:
  `getWrittenBytes` in interface `IConnection`
Overrides:
  `getWrittenBytes` in class `RTMPConnection`
Returns:
  bytes written

#### getPendingMessages

    public long getPendingMessages()

Total number of messages that are pending to be sent to the connection.

Specified by:
  `getPendingMessages` in interface `IConnection`
Overrides:
  `getPendingMessages` in class `BaseConnection`
Returns:
  pending messages

#### decode

    public List<?> decode(IoBuffer data)

Decode data sent by the client.

Parameters:
  `data` - the data to decode
Returns:
  a list of decoded objects

#### write

    public void write(Packet packet)

Send RTMP packet down the connection.

Specified by:
  `write` in class `RTMPConnection`
Parameters:
  `packet` - the packet to send

#### foldPendingMessages

    protected IoBuffer foldPendingMessages(int targetSize)

#### setHandler

    public void setHandler(IRTMPHandler handler)

#### setDecoder

    public void setDecoder(RTMPProtocolDecoder decoder)

#### setEncoder

    public void setEncoder(RTMPProtocolEncoder encoder)