Tech-Tales and Tasty Trials! – Exploring Tech, Tastes, and Terrains!

Recent News

Copyright © 2025. All Right Reserved.

ServerSocket class in java

Share It:

Table of Content

To implement TCP/IP connections, the java.net package provides two classes, ServerSocket and Socket. A ServerSocket represents a listening socket that waits for connection requests from clients. S ServerSocket does not itself participate in connections it just listens for connections request and creates Sockets to handle the actual connection.

 A Socket represents one endpoint of an actual network connection.  A socket can be a client socket that sends a connection request to a server.  

The difference between handling Socket and ServerSocket is:

  1. ServerSocket is implemented on the server-side so that it can listen to the client’s requests and respond to them. While a socket is implemented at the client-side to send requests to the port of the machine where ServerSocket is listening.
  2. The socket class is used for the client side whereas ServerSocket is used for the server side.

Winner

Tech-Tales and Tasty Trials! — Exploring Tech, Tastes, and Terrains! Join me, A CS grad passionate about Tech, as I explore the world—savoring flavors, uncovering innovations, and blending tech with travel. Let’s decode the world, one byte at a time!

https://completethings.com

Grid News

Latest Post

Find Us on Youtube

Tech-Tales and Tasty Trials! — Exploring Tech, Tastes, and Terrains!
Join me, A CS grad passionate about Tech, as I explore the world—savoring flavors, uncovering innovations, and blending tech with travel. Let’s decode the world, one byte at a time!

Latest News

Most Popular

Copyright © 2025 All Right Reserved.