aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes confusion about ports... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "confusion about ports..." Watch "confusion about ports..." New topic
Author

confusion about ports...

karthick chinnathambi
Ranch Hand

Joined: Jul 06, 2009
Posts: 196

a port is used to identify a specific software program on the server....


does that mean each and every web-application needs to be deployed in a separate port?

what is a socket for?

what's the exact difference between a socket and a port........?






KARTHICK.C , SCJP6-93%
(Born to Win)
Ryan Beckett
Ranch Hand

Joined: Feb 22, 2009
Posts: 192
A Network Port number specifies an area in memory (or "endpoint") that your network interface sends incoming data to. Sometimes I think it's easier to imagine it from a networking perspective. An application can listen on multiple ports. Your application (using a ServerSocket for instance) will look there for data sent over the network to be processed. Only applications using TCP/IP communication use ports. A Network Socket is a "channel" that is the flow of data to a specific thread or process, whereas a port can be a data source for multiple sockets. A socket depends on an IP address and port. For instance, you could be running Tomcat on port 8080 and create a Java Server app listening on port 8080 as well. Sun has a networking tutorial.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2247

Howdy, Karthick!

Maybe it would have been more proper if this question was asked in the Sockets and Internet Protocols forum. Remember to carefully choose one forum before asking a question!


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
karthick chinnathambi
Ranch Hand

Joined: Jul 06, 2009
Posts: 196

friends i am reading the first chapter in Head First servlets.....

i came through these terms........
i always had confusion on these terms....

as i am preparing for SCWCD i posted here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: confusion about ports...
 
Similar Threads
port vs socket
how to give port number for socket class
problem in java.net.Bind Exception
ServerSocketChannel.accept() seems to create a random port to send data to?
see proxy port