Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The netstat output with the tomcat process(pid: 28899) is as followed:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN      28899/java      
....
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      28899/java        
....
tcp        0      0 127.0.0.1:8005          0.0.0.0:*               LISTEN      28899/java 

So why can one process listen on three tcp ports? Is it because that 8009 and 8005 are listened by two child-processes of tomcat and netstat only display the parent process ID?

share|improve this question
    
What makes you think there's a limit to the number of sockets/ports a single process can open and listen to? –  growse Nov 6 '12 at 21:05
add comment

2 Answers 2

The short answer is "because the process asked the kernel to let it bind to three ports". There's no implicit bar on this; here's my apache, merrily listening to two ports:

[madhatta@lory mail]$ sudo netstat -apn|grep http
tcp        0      0 178.18.123.145:443          0.0.0.0:*                   LISTEN      1753/httpd          
tcp        0      0 :::80                       :::*                        LISTEN      1753/httpd          
share|improve this answer
add comment

More specifically, 8009 is the default AJP connector port for Tomcat (for, say, mod_ajp in Apache to communicate with Tomcat) and localhost:8005 is the default shutdown port. Presumably, you're using 8000 as the HTTP connector port. You should be able to find a more in depth discussion in the Tomcat documentation.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.