This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android 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
Author

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?

Justin


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

Hello,

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

FYI:
http://www.iana.org/assignments/port-numbers
Rahul Bhattacharjee
Ranch Hand

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


Rahul Bhattacharjee
LinkedIn - Blog
 
Don't get me started about those stupid light bulbs.
 
subject: can a server have more than one port?
 
Similar Threads
could anyone please answer this question.....
a question about port
Single Instance app, need to access object outside the scope
Doubt on Protocol & Port number
Can anyone explain this JNDI setting to me?