## org.red5.server.net.rtmp
Class RTMPClient

    java.lang.Object
      org.red5.server.net.rtmp.BaseRTMPHandler
          org.red5.server.net.rtmp.BaseRTMPClientHandler
              org.red5.server.net.rtmp.RTMPClient

All Implemented Interfaces:
  IRTMPHandler, Constants, StatusCodes, ApplicationContextAware

Direct Known Subclasses:
  RTMPSClient

    public class RTMPClient

extends BaseRTMPClientHandler

RTMP client object. Initial client mode code by Christian Eckerle.

Author:
  The Red5 Project (red5@osflash.org), Christian Eckerle (ce@publishing-etc.de), Joachim Bauch (jojo@struktur.de), Paul Gregoire (mondain@gmail.com), Steven Gong (steven.gong@gmail.com), Anton Lebedevich (mabrek@gmail.com), Tiago Daniel Jacobs (tiago@imdt.com.br)

Field Summary
`protected static int` `CONNECTOR_WORKER_TIMEOUT`
`protected SocketConnector` `socketConnector` Socket connector, disposed on disconnect

Fields inherited from interface org.red5.server.net.rtmp.message.Constants

`HANDSHAKE_SIZE, HEADER_CONTINUE, HEADER_NEW, HEADER_SAME_SOURCE, HEADER_TIMER_CHANGE, MEDIUM_INT_MAX, SO_CLIENT_CLEAR_DATA, SO_CLIENT_DELETE_DATA, SO_CLIENT_INITIAL_DATA, SO_CLIENT_SEND_MESSAGE, SO_CLIENT_STATUS, SO_CLIENT_UPDATE_ATTRIBUTE, SO_CLIENT_UPDATE_DATA, SO_CONNECT, SO_DELETE_ATTRIBUTE, SO_DISCONNECT, SO_SEND_MESSAGE, SO_SET_ATTRIBUTE, SOURCE_TYPE_LIVE, SOURCE_TYPE_VOD, TYPE_ABORT, TYPE_AGGREGATE, TYPE_AUDIO_DATA, TYPE_BYTES_READ, TYPE_CHUNK_SIZE, TYPE_CLIENT_BANDWIDTH, TYPE_FLEX_MESSAGE, TYPE_FLEX_SHARED_OBJECT, TYPE_FLEX_STREAM_SEND, TYPE_INVOKE, TYPE_NOTIFY, TYPE_PING, TYPE_SERVER_BANDWIDTH, TYPE_SHARED_OBJECT, TYPE_STREAM_METADATA, TYPE_VIDEO_DATA`

Fields inherited from interface org.red5.server.net.rtmp.status.StatusCodes

`APP_GC, APP_RESOURCE_LOWMEMORY, APP_SCRIPT_ERROR, APP_SCRIPT_WARNING, APP_SHUTDOWN, NC_CALL_BADVERSION, NC_CALL_FAILED, NC_CONNECT_APPSHUTDOWN, NC_CONNECT_CLOSED, NC_CONNECT_FAILED, NC_CONNECT_INVALID_APPLICATION, NC_CONNECT_REJECTED, NC_CONNECT_SUCCESS, NS_CLEAR_FAILED, NS_CLEAR_SUCCESS, NS_DATA_START, NS_FAILED, NS_INVALID_ARGUMENT, NS_PAUSE_NOTIFY, NS_PLAY_COMPLETE, NS_PLAY_FAILED, NS_PLAY_FILE_STRUCTURE_INVALID, NS_PLAY_INSUFFICIENT_BW, NS_PLAY_NO_SUPPORTED_TRACK_FOUND, NS_PLAY_PUBLISHNOTIFY, NS_PLAY_RESET, NS_PLAY_START, NS_PLAY_STOP, NS_PLAY_STREAMNOTFOUND, NS_PLAY_SWITCH, NS_PLAY_UNPUBLISHNOTIFY, NS_PUBLISH_BADNAME, NS_PUBLISH_START, NS_RECORD_FAILED, NS_RECORD_NOACCESS, NS_RECORD_START, NS_RECORD_STOP, NS_SEEK_FAILED, NS_SEEK_NOTIFY, NS_UNPAUSE_NOTIFY, NS_UNPUBLISHED_SUCCESS, SO_CREATION_FAILED, SO_NO_READ_ACCESS, SO_NO_WRITE_ACCESS, SO_PERSISTENCE_MISMATCH`

Constructor Summary
`RTMPClient()` Constructs a new RTMPClient.

Method Summary
`void` `disconnect()` Disconnect the first connection in the connection map
`Map<String,Object>` `makeDefaultConnectionParams(String server, int port, String application)`
`protected void` `startConnector(String server, int port)` Start network connection to server

Methods inherited from class org.red5.server.net.rtmp.BaseRTMPClientHandler

`connect, connect, connect, connect, connect, connectionClosed, connectionOpened, createStream, getChannelForStreamId, getCodecFactory, getConnManager, getSharedObject, handleException, invoke, invoke, onChunkSize, onInvoke, onPing, onSharedObject, play, publish, publishStreamData, setCodecFactory, setConnectionClosedHandler, setExceptionHandler, setServiceProvider, setStreamEventDispatcher, unpublish`

Methods inherited from class org.red5.server.net.rtmp.BaseRTMPHandler
`getHostname, getStreamId, handlePendingCallResult, messageReceived, messageSent, onStreamBytesRead, setApplicationContext`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### CONNECTOR_WORKER_TIMEOUT

    protected static final int CONNECTOR_WORKER_TIMEOUT

See Also:
  Constant Field Values

### socketConnector

    protected SocketConnector socketConnector

  Socket connector, disposed on disconnect

Constructor Detail

### RTMPClient

    public RTMPClient()

  Constructs a new RTMPClient.

Method Detail

### makeDefaultConnectionParams

    public Map<String,Object> makeDefaultConnectionParams(String server,
                                                          int port,
                                                          String application)

  Overrides:
    `makeDefaultConnectionParams` in class `BaseRTMPClientHandler`
  Parameters:
    `server` - Server
    `port` - Connection port
    `application` - Application at that server
  Returns:
    default connection parameters

### startConnector

    protected void startConnector(String server,
                                  int port)

  Description copied from class: `BaseRTMPClientHandler`
  Start network connection to server

  Specified by:
    `startConnector` in class `BaseRTMPClientHandler`
  Parameters:
    `server` - Server
    `port` - Connection port

### disconnect

    public void disconnect()

  Description copied from class: `BaseRTMPClientHandler`
  Disconnect the first connection in the connection map

  Overrides:
    `disconnect` in class `BaseRTMPClientHandler`

Copyright © 2006-2010 The Red5 Project