Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Default Socket UDP or TCP  RSS feed

 
Sachin H. Gupta
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the Java.net.Socket and java.net.ServerSocket classes use UDP or TCP?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This http://docs.oracle.com/javase/tutorial/networking/overview/networking.html is a good starting point for networking APIs in Java. As noted in that documentation (at the end of the page):


Networking Classes in the JDK

Through the classes in java.net, Java programs can use TCP or UDP to communicate over the Internet. The URL, URLConnection, Socket, and ServerSocket classes all use TCP to communicate over the network. The DatagramPacket, DatagramSocket, and MulticastSocket classes are for use with UDP.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!