• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

can we use same port(exp 80) if we use different protocols

 
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i need to know can we use same port(exp 80) if we use different protocols(HTTP and FTP)
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sam liyanage wrote:i need to know can we use same port(exp 80) if we use different protocols(HTTP and FTP)



When you say "use the same port", do you mean for two applications to try to bind to the same local port? Do you do mean for two applications to try to use the same remote port? Do you mean a single server binding to the same port, but serving two different protocols? Etc. We need a bit of clarification please.

Henry
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i found below in JSP & SERVLET book.please explain

using one server app per port,a server can have up to 65536 different server apps running(although it's possible to run more than one app on the same port if the apps use different protocols)

 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sam liyanage wrote:i found below in JSP & SERVLET book.please explain

using one server app per port,a server can have up to 65536 different server apps running(although it's possible to run more than one app on the same port if the apps use different protocols)



I believe that the "protocol" being referred to here is the transport level protocol -- meaning either "TCP" or "UDP".

And yes, it is supposedly possible. Never tried it myself though. If you want to confirm it, it should be straightforward to test -- just create a ServerSocket and a DatagramSocket using the same local bind port.

Henry
 
reply
    Bookmark Topic Watch Topic
  • New Topic