Skip to content
Snippets Groups Projects
Commit 9f225aeb authored by Paul Gregoire's avatar Paul Gregoire
Browse files

Externalize max_poll_time for RTMPConnection

parent 11434168
No related branches found
No related tags found
No related merge requests found
...@@ -295,6 +295,11 @@ public abstract class RTMPConnection extends BaseConnection implements IStreamCa ...@@ -295,6 +295,11 @@ public abstract class RTMPConnection extends BaseConnection implements IStreamCa
*/ */
protected long maxHandlingTimeout = 500L; protected long maxHandlingTimeout = 500L;
/**
* Maximum time in milliseconds to wait for a message.
*/
private long maxPollTimeout = 10000L;
/** /**
* Bandwidth limit type / enforcement. (0=hard,1=soft,2=dynamic) * Bandwidth limit type / enforcement. (0=hard,1=soft,2=dynamic)
*/ */
...@@ -1513,7 +1518,7 @@ public abstract class RTMPConnection extends BaseConnection implements IStreamCa ...@@ -1513,7 +1518,7 @@ public abstract class RTMPConnection extends BaseConnection implements IStreamCa
do { do {
try { try {
// DTS appears to be off only by < 10ms // DTS appears to be off only by < 10ms
Packet p = receivedPacketQueue.poll(10000L, TimeUnit.MILLISECONDS); // wait for a packet up to 10 seconds Packet p = receivedPacketQueue.poll(maxPollTimeout, TimeUnit.MILLISECONDS); // wait for a packet up to 10 seconds
if (p != null) { if (p != null) {
if (isTrace) { if (isTrace) {
log.trace("Handle received packet: {}", p); log.trace("Handle received packet: {}", p);
...@@ -1860,6 +1865,14 @@ public abstract class RTMPConnection extends BaseConnection implements IStreamCa ...@@ -1860,6 +1865,14 @@ public abstract class RTMPConnection extends BaseConnection implements IStreamCa
this.maxHandlingTimeout = maxHandlingTimeout; this.maxHandlingTimeout = maxHandlingTimeout;
} }
public long getMaxPollTimeout() {
return maxPollTimeout;
}
public void setMaxPollTimeout(long maxPollTimeout) {
this.maxPollTimeout = maxPollTimeout;
}
public int getChannelsInitalCapacity() { public int getChannelsInitalCapacity() {
return channelsInitalCapacity; return channelsInitalCapacity;
} }
......
...@@ -112,6 +112,8 @@ ...@@ -112,6 +112,8 @@
<property name="maxInactivity" value="${rtmp.max_inactivity}" /> <property name="maxInactivity" value="${rtmp.max_inactivity}" />
<!-- Max. time in milliseconds to wait for a valid handshake. --> <!-- Max. time in milliseconds to wait for a valid handshake. -->
<property name="maxHandshakeTimeout" value="${rtmp.max_handshake_time}" /> <property name="maxHandshakeTimeout" value="${rtmp.max_handshake_time}" />
<!-- Max. time in milliseconds to wait for a message while polling -->
<property name="maxPollTimeout" value="${rtmp.max_poll_time}" />
<!-- Default server bandwidth per connection --> <!-- Default server bandwidth per connection -->
<property name="defaultServerBandwidth" value="${rtmp.default_server_bandwidth}" /> <property name="defaultServerBandwidth" value="${rtmp.default_server_bandwidth}" />
<!-- Default client bandwidth per connection --> <!-- Default client bandwidth per connection -->
......
...@@ -23,6 +23,8 @@ rtmp.max_read_buffer_size=65536 ...@@ -23,6 +23,8 @@ rtmp.max_read_buffer_size=65536
rtmp.ping_interval=1000 rtmp.ping_interval=1000
rtmp.max_inactivity=60000 rtmp.max_inactivity=60000
rtmp.max_handshake_time=5000 rtmp.max_handshake_time=5000
# maximum time to wait for a message while polling in milliseconds
rtmp.max_poll_time=10000
rtmp.tcp_nodelay=true rtmp.tcp_nodelay=true
rtmp.tcp_keepalive=false rtmp.tcp_keepalive=false
rtmp.default_server_bandwidth=10000000 rtmp.default_server_bandwidth=10000000
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment