org.red5.server.net.rtmp
Class RTMPOriginConnection

java.lang.Object
  extended by org.red5.server.AttributeStore
      extended by org.red5.server.BaseConnection
          extended by org.red5.server.net.rtmp.RTMPConnection
              extended by org.red5.server.net.rtmp.RTMPOriginConnection
All Implemented Interfaces:
IEventDispatcher, IEventHandler, IEventListener, IAttributeStore, ICastingAttributeStore, IConnection, ICoreObject, IServiceCapableConnection, IStreamCapableConnection, AttributeStoreMXBean

public class RTMPOriginConnection
extends RTMPConnection

A pseudo-connection on Origin that represents a client on Edge. The connection is created behind a MRTMP connection so no handshake job or keep-alive job is necessary. No raw byte data write is needed either.

Version:
$Id$
Author:
Steven Gong (steven.gong@gmail.com)

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, nextBytesRead, RTMP_CONNECTION_KEY, RTMP_ENCRYPTED, RTMP_HANDSHAKE, RTMP_NON_ENCRYPTED, RTMPE_CIPHER_IN, RTMPE_CIPHER_OUT
 
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
RTMPOriginConnection(String type, int clientId)
           
RTMPOriginConnection(String type, int clientId, int ioSessionId)
           
 
Method Summary
 void close()
          Closes connection
 int getIoSessionId()
           
 RTMP getState()
           
protected  void onInactive()
          Inactive state event handler.
 void rawWrite(IoBuffer out)
          Write raw byte buffer.
 void realClose()
           
 void setHandler(OriginMRTMPHandler handler)
           
 void setMrtmpManager(IMRTMPOriginManager mrtmpManager)
           
 void startRoundTripMeasurement()
          Starts measurement.
protected  void startWaitForHandshake(ISchedulingService service)
          Start waiting for a valid handshake.
 void write(Packet packet)
          Write packet.
 
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, getReadBytes, getStateCode, getStreamByChannelId, getStreamById, getStreamIdForChannel, getStreams, getUsedStreamCount, getWrittenBytes, hashCode, invoke, invoke, invoke, invoke, invoke, invoke, isChannelUsed, messageDropped, messageReceived, messageSent, newBroadcastStream, newPlaylistSubscriberStream, newSingleItemSubscriberStream, notify, notify, notify, notify, ping, ping, pingReceived, receivedBytesRead, registerDeferredResult, registerPendingCall, rememberStreamBufferDuration, removeClientStream, reserveStreamId, retrievePendingCall, sendPendingServiceCallsCloseError, setId, setMaxHandshakeTimeout, setMaxInactivity, setPingInterval, setSchedulingService, setState, setStateCode, setup, toString, unregisterDeferredResult, unreserveStreamId, updateBytesRead, writingMessage
 
Methods inherited from class org.red5.server.BaseConnection
connect, dispatchEvent, getBasicScopes, getClient, getConnectParams, getDroppedMessages, getHost, getNextClientId, getPath, getPendingMessages, getReadLock, getReadMessages, getRemoteAddress, getRemoteAddresses, getRemotePort, getScope, getSessionId, getType, getWriteLock, getWrittenMessages, handleEvent, initialize, isConnected, notifyEvent, registerBasicScope, unregisterBasicScope
 
Methods inherited from class org.red5.server.AttributeStore
filterNull, 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, getPendingMessages, getReadMessages, getRemoteAddress, getRemoteAddresses, getRemotePort, getScope, getSessionId, getType, getWrittenMessages, initialize, isConnected
 
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
 
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
 

Constructor Detail

RTMPOriginConnection

public RTMPOriginConnection(String type,
                            int clientId)

RTMPOriginConnection

public RTMPOriginConnection(String type,
                            int clientId,
                            int ioSessionId)
Method Detail

getIoSessionId

public int getIoSessionId()

setMrtmpManager

public void setMrtmpManager(IMRTMPOriginManager mrtmpManager)

setHandler

public void setHandler(OriginMRTMPHandler handler)

getState

public RTMP getState()
Overrides:
getState in class RTMPConnection

onInactive

protected void onInactive()
Description copied from class: RTMPConnection
Inactive state event handler.

Specified by:
onInactive in class RTMPConnection

rawWrite

public void rawWrite(IoBuffer out)
Description copied from class: RTMPConnection
Write raw byte buffer.

Specified by:
rawWrite in class RTMPConnection
Parameters:
out - IoBuffer

write

public void write(Packet packet)
Description copied from class: RTMPConnection
Write packet.

Specified by:
write in class RTMPConnection
Parameters:
packet - Packet

startRoundTripMeasurement

public void startRoundTripMeasurement()
Description copied from class: RTMPConnection
Starts measurement.

Overrides:
startRoundTripMeasurement in class RTMPConnection

startWaitForHandshake

protected void startWaitForHandshake(ISchedulingService service)
Description copied from class: RTMPConnection
Start waiting for a valid handshake.

Overrides:
startWaitForHandshake in class RTMPConnection
Parameters:
service - The scheduling service to use

close

public void close()
Description copied from class: RTMPConnection
Closes connection

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

realClose

public void realClose()


Copyright © 2006-2010 The Red5 Project