• Post Reply Bookmark Topic Watch Topic
  • New Topic

diffrence between socket connection and URLConnection  RSS feed

 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hy friends,

though, i know and often work on it but it might be more conceptual for me to know your perception.

by the way, what are the main points which diffrentiate the connection between client and server using

1) sokets which in tern using ClientSocket,ServerSocket... classes
2) URL directly which in tern using HttpURLConnection,URLConnection...classes

any help would greatly appreciated
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A socket is an endpoint for communication between two machines.

java.net.Socket

Class URL represents a Uniform Resource Locator, a pointer to a "resource" on the World Wide Web. A resource can be something as simple as a file or a directory, or it can be a reference to a more complicated object, such as a query to a database or to a search engine.

java.net.URL

Sockets are low-level connections involving byte streams. URL/URLConnection/HttpURLConnection are abstractions of some protocol (HTTP, FTP).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!