This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes can a server have more than one port? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can a server have more than one port?" Watch "can a server have more than one port?" New topic

can a server have more than one port?

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
can a server listen on more than one port at a time?


You down with OOP? Yeah you know me!
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
Yes. A Java process can listen on many ports.

For example, Tomcat supports this by allowing you to define multiple connectors in the server.xml file.
Srinivas Kalvala
Ranch Hand

Joined: Oct 20, 2005
Posts: 257


A program can run different threads which will listen on different ports.
But in single thread server can listen to only one port.

Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Server is nothing but a program listening at some can write a server which listens at any number of ports.

Rahul Bhattacharjee
LinkedIn - Blog
I agree. Here's the link:
subject: can a server have more than one port?
It's not a secret anymore!