• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can a server have more than one port?

 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can a server listen on more than one port at a time?

Justin
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 257
Firefox Browser Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server is nothing but a program listening at some port..you can write a server which listens at any number of ports.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic