aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes why we use socket programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "why we use socket programming " Watch "why we use socket programming " New topic
Author

why we use socket programming

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1223
i need to know what is the advantage of using Socket programming as there are other protocols above it(HTTP,TCP....)?
Steve Kedzie
Greenhorn

Joined: Jul 30, 2014
Posts: 22

Sam,

First off, socket programming is not a protocol and is necessary for network programming. In a nutshell, protocols such as HTTP, TCP, UDP, ect - would not have a means to "communicate" without socket programming. Basically, socket programming provides the logical interface that protocols use for sending and receiving data over a network. This link will take you to Oracle's socket tutorial:

http://docs.oracle.com/javase/tutorial/networking/sockets/

I hope the above link helps you gain a deeper understanding of sockets programming in Java. Good luck!

Steve
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1223
Thanks
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2434
    
  28

TCP protocol is not above sockets. The socket API allows you to communicate using TCP. From a programmers POV, socket programming IS TCP
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18990
    
  40

Jayesh A Lalwani wrote:TCP protocol is not above sockets. The socket API allows you to communicate using TCP. From a programmers POV, socket programming IS TCP


Just for completion only. The other protocol that sockets supports is UDP. See the DatagramSocket class for sending/reveiving UDP on a unicast address, and MulticastSocket for sending/receiving on a multicast group.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why we use socket programming