# RTSPPort.bind: java.lang.IllegalArgumentException: port out of range

**URL:** <https://community.wowza.com/t/rtspport-bind-java-lang-illegalargumentexception-port-out-of-range/290>\
**Category:** Wowza Streaming Engine\
**Created:** [January 10, 2011, 4:17pm UTC](https://community.wowza.com/t/rtspport-bind-java-lang-illegalargumentexception-port-out-of-range/290 "2011-01-10T16:17:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)\
**Post date:** [January 10, 2011, 4:17pm UTC](https://community.wowza.com/t/rtspport-bind-java-lang-illegalargumentexception-port-out-of-range/290/1 "2011-01-10T16:17:59Z")

</div>

hi

we’re using a single instance of wowza, rtsp broadcasters (50 to 100 simultaneous), player clients using rtsp and coupertino streams, multiple times a day wowza needs restart, because ports reaches 65k+.

RTSPPort.bind: java.lang.IllegalArgumentException: port out of range:69652

Ubuntu Linux, Default wowza configuration (using /vod application)

Configure logging: file:///usr/local/WowzaMediaServer/conf/log4j.properties

INFO server server-start Wowza Media Server 2 Subscription 2.2.3 build26454 -

INFO server comment - Maximum connections: Unlimited

INFO server comment - Hardware Available Processors: 4

INFO server comment - Hardware Physical Memory: 504MB/6083MB

INFO server comment - Hardware Swap Space: 5717MB/5718MB

INFO server comment - Max File Descriptor Count: 20000

INFO server comment - Open File Descriptor Count: 37

INFO server comment - OS Name: Linux

INFO server comment - OS Version: 2.6.24-19-server

INFO server comment - OS Architecture: i386

INFO server comment - Java Name: Java HotSpot™ Server VM

INFO server comment - Java Vendor: Sun Microsystems Inc.

INFO server comment - Java Version: 1.6.0\_17

INFO server comment - Java VM Version: 14.3-b01

INFO server comment - Java Spec Version: 1.6

INFO server comment - Java Home: /usr/lib/jvm/java-6-sun-1.6.0.17/jre

INFO server comment - Java Max Heap Size: 1155MB

INFO server comment - Java Architecture: 32

INFO server comment - Java Encoding[file.encoding]: UTF-8

INFO server comment - Java Args[0]: -Xmx1200M

INFO server comment - Java Args[1]: -Djava.net.preferIPv4Stack=true

INFO server comment - Java Args[2]: -Dcom.sun.management.jmxremote=true

INFO server comment - Java Args[3]: -Dcom.wowza.wms.AppHome=/usr/local/WowzaMediaServer

INFO server comment - Java Args[4]: -Dcom.wowza.wms.ConfigURL=

INFO server comment - Java Args[5]: -Dcom.wowza.wms.ConfigHome=/usr/local/WowzaMediaServer

INFO server comment - Java GC[0]: PS Scavenge

INFO server comment - Java GC[1]: PS MarkSweep

INFO server comment - Server threads[h/t]: 10/10

INFO server comment - CMDInterface now listening: [any]:8083

INFO vhost vhost-start _defaultVHost_ -

INFO server comment - _defaultVHost_ threads[h/t]:120/80 home:/usr/local/WowzaMediaServer

INFO vhost comment _defaultVHost_ Bind attempt ([any]:1935:4)

INFO vhost comment _defaultVHost_ Bind successful ([any]:1935)

INFO vhost comment _defaultVHost_ Bind attempt ([any]:8086:1)

INFO vhost comment _defaultVHost_ Bind successful ([any]:8086)

INFO server comment - Wowza Media Server is started!

is there any configuration param, or workaround to solve this problem? i dont find any relevant post.

thanks!

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [January 10, 2011, 8:48am UTC](https://community.wowza.com/t/rtspport-bind-java-lang-illegalargumentexception-port-out-of-range/290/2 "2011-01-10T08:48:21Z")

</div>

In Server.xml what do you have RTP/DatagramStartingPort. The default settings is 6970. This instructs Wowza to use the UDP port range: 6970 to 65535. Each stream should use 4 ports. We recycle ports after they are used. There is a timeout period of 10 minutes before a port is recycled. If you are only stream to a few hundred concurrents it should take a long time to run out of ports. You can certainly shorten the timeout period to say 1 minute to see if that helps:

```auto
UDPPortManager udpPortManager = Server.getInstance().getUDPPortManager();
udpPortManager.setPortRecycleTime(1*60*1000); // one minute in milliseconds

```

Charlie

Charlie

---

<div class="post-metadata">

**Author:** ![Balazs\_Hollosi](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@Balazs\_Hollosi](https://community.wowza.com/u/Balazs_Hollosi)\
**Post date:** [January 10, 2011, 5:26pm UTC](https://community.wowza.com/t/rtspport-bind-java-lang-illegalargumentexception-port-out-of-range/290/3 "2011-01-10T17:26:22Z")

</div>

default configuration:

6970

false

streams came from outdoor cameras, sometimes very bugous, and in this case, our converter may restarts the broadcast sessions up to 4-5times in a minute.

i will try decrease the port recycle time, thanks Charlie.
