From 3d00478e7391d203d055e565d677b94853b9abbd Mon Sep 17 00:00:00 2001 From: nateroe Date: Thu, 22 Jul 2021 13:25:41 -0700 Subject: [PATCH 1/3] in comment, seconds -> milliseconds --- src/main/java/org/red5/client/net/rtmp/RTMPClient.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/red5/client/net/rtmp/RTMPClient.java b/src/main/java/org/red5/client/net/rtmp/RTMPClient.java index 6eda9fd..5c827c2 100644 --- a/src/main/java/org/red5/client/net/rtmp/RTMPClient.java +++ b/src/main/java/org/red5/client/net/rtmp/RTMPClient.java @@ -33,10 +33,9 @@ * @author Jon Valliere */ public class RTMPClient extends BaseRTMPClientHandler { - private static final Logger log = LoggerFactory.getLogger(RTMPClient.class); - protected static final int CONNECTOR_WORKER_TIMEOUT = 7000; // seconds + protected static final int CONNECTOR_WORKER_TIMEOUT = 7000; // milliseconds // I/O handler protected final RTMPMinaIoHandler ioHandler; @@ -137,5 +136,4 @@ public void setProtocol(String protocol) throws Exception { throw new Exception("Unsupported protocol specified, please use the correct client for the intended protocol."); } } - } From 40836e52c9e91b3321f000e8d77f3af2befce7ce Mon Sep 17 00:00:00 2001 From: nateroe Date: Thu, 22 Jul 2021 13:26:32 -0700 Subject: [PATCH 2/3] reinstate old startConnector override to fix RTMPS [RPRO-8658] --- .../red5/client/net/rtmps/RTMPSClient.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/main/java/org/red5/client/net/rtmps/RTMPSClient.java b/src/main/java/org/red5/client/net/rtmps/RTMPSClient.java index 205e208..afd0287 100644 --- a/src/main/java/org/red5/client/net/rtmps/RTMPSClient.java +++ b/src/main/java/org/red5/client/net/rtmps/RTMPSClient.java @@ -7,10 +7,15 @@ package org.red5.client.net.rtmps; +import java.net.InetSocketAddress; + import javax.net.ssl.SSLContext; +import org.apache.mina.core.future.IoFuture; +import org.apache.mina.core.future.IoFutureListener; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.ssl.SslFilter; +import org.apache.mina.transport.socket.nio.NioSocketConnector; import org.red5.client.net.rtmp.RTMPClient; import org.red5.client.net.rtmp.RTMPMinaIoHandler; import org.red5.client.net.ssl.BogusSslContextFactory; @@ -56,6 +61,34 @@ public RTMPSClient() { ioHandler.setHandler(this); } + @SuppressWarnings({ "rawtypes" }) + @Override + protected void startConnector(String server, int port) { + socketConnector = new NioSocketConnector(); + socketConnector.setHandler(ioHandler); + future = socketConnector.connect(new InetSocketAddress(server, port)); + future.addListener(new IoFutureListener() { + @Override + public void operationComplete(IoFuture future) { + try { + // will throw RuntimeException after connection error + future.getSession(); + } catch (Throwable e) { + //if there isn't an ClientExceptionHandler set, a + //RuntimeException may be thrown in handleException + handleException(e); + } + } + }); + // Do the close requesting that the pending messages are sent before + // the session is closed + //future.getSession().close(false); + // Now wait for the close to be completed + future.awaitUninterruptibly(CONNECTOR_WORKER_TIMEOUT); + // We can now dispose the connector + //socketConnector.dispose(); + } + /** * Password used to access the keystore file. * From bd2957d1f6db70ededfcd1baeda0f8bb11c2cf3c Mon Sep 17 00:00:00 2001 From: nateroe Date: Thu, 22 Jul 2021 13:35:33 -0700 Subject: [PATCH 3/3] bump version to 1.2.9 --- pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6ed0d45..2f4b10e 100644 --- a/pom.xml +++ b/pom.xml @@ -69,6 +69,10 @@ https://oss.sonatype.org/content/repositories/releases + 1.2.9 + + 1.2.8 + install @@ -118,7 +122,7 @@ org.red5 red5-server-common - ${project.version} + ${red5.version} org.apache.mina