Class RTMPClient

All Implemented Interfaces:
IRTMPClient, IRTMPHandler, Constants, StatusCodes
Direct Known Subclasses:
RTMPEClient, RTMPSClient

public class RTMPClient extends BaseRTMPClientHandler
RTMP client implementation supporting "rtmp" and "rtmpe" protocols.
Author:
The Red5 Project, 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), Jon Valliere
  • Field Details

    • CONNECTOR_WORKER_TIMEOUT

      protected static final int CONNECTOR_WORKER_TIMEOUT
      See Also:
    • ioHandler

      protected final RTMPMinaIoHandler ioHandler
    • socketConnector

      protected org.apache.mina.transport.socket.SocketConnector socketConnector
    • future

      protected org.apache.mina.core.future.ConnectFuture future
    • session

      protected org.apache.mina.core.session.IoSession session
  • Constructor Details

    • RTMPClient

      public RTMPClient()
      Constructs a new RTMPClient.
  • Method Details

    • makeDefaultConnectionParams

      public Map<String,Object> makeDefaultConnectionParams(String server, int port, String application)
      Creates the default connection parameters collection. Many implementations of this handler will create a tcUrl if not found, it is created with the current server url.
      Specified by:
      makeDefaultConnectionParams in interface IRTMPClient
      Overrides:
      makeDefaultConnectionParams in class BaseRTMPClientHandler
      Parameters:
      server - the server location
      port - the port for the protocol
      application - the application name at the given server
      Returns:
      connection parameters map
    • startConnector

      protected void startConnector(String server, int port)
      Start network connection to server
      Specified by:
      startConnector in class BaseRTMPClientHandler
      Parameters:
      server - Server
      port - Connection port
    • disconnect

      public void disconnect()
      Disconnect the first connection in the connection map
      Specified by:
      disconnect in interface IRTMPClient
      Overrides:
      disconnect in class BaseRTMPClientHandler
    • setProtocol

      public void setProtocol(String protocol) throws Exception
      Sets the RTMP protocol, the default is "rtmp". If "rtmps" or "rtmpt" are required, the appropriate client type should be selected.
      Overrides:
      setProtocol in class BaseRTMPClientHandler
      Parameters:
      protocol - the protocol to set
      Throws:
      Exception - thrown