• Post Reply Bookmark Topic Watch Topic
  • New Topic

Connecting to a server application, Head First Java 2nd Edition pg 477  RSS feed

 
John Drulo
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book states the following:
"Typically,
if someone writes a network service
and wants others to write clients for
it , they'll publish the lP address, port
number, and protocol for the service."


It has been previously stated in the text that in order to connect to an application on a server, the port number of the application and the IP address of the server suffices. Is the protocol used by the application necessary? In which cases are they necessary and in which cases can we make do without them? What is a protocol in the first place? How does it aid in connecting to the server application?
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the Wikipedia definition of a Protocol: http://en.wikipedia.org/wiki/Communications_protocol
 
Tomas Linhart
Ranch Hand
Posts: 86
2
Java Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Considering the TCP/IP model, IP address and port number also specify protocols. On each TCP/IP layer there live plenty of protocols. IP address corresponds to the Internet layer and port number to the Application layer. What you mean by "protocol" in your post would then correspond to the Transport layer, and would be typically TCP or UDP protocol. Specifying protocols on each layer makes the communication path complete. For example to specify the availability of web server, you would give its IP address (i.e. 209.85.229.104), transport protocol(TCP) and port number (80).
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In short, a protocol is an agreement of what data to send over the connection, and how to do so. HTTP is a common protocol web clients and servers use. A connection between two machines doesn't do much good if both sides don't agree about who gets to talk, and which language to speak - just like a communication between two people. That's what a protocol determines.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!