Class RTMPClient

  • All Implemented Interfaces:
    IRTMPClient, org.red5.server.net.rtmp.IRTMPHandler, org.red5.server.net.rtmp.message.Constants, org.red5.server.net.rtmp.status.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 Detail

      • CONNECTOR_WORKER_TIMEOUT

        protected static final int CONNECTOR_WORKER_TIMEOUT
        See Also:
        Constant Field Values
      • 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 Detail

      • RTMPClient

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

      • 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
      • 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