What Does Socket Mean?

A socket is a software object that acts as an end point establishing a bidirectional network communication link between a server-side and a client-side program.


In UNIX, a socket can also be referred to as an endpoint for interprocess communication(IPC) within the operating system(OS).

In Java, socket classes represent the communication between client and server programs. Socket classes handle client-side communication, and server socket classes handle server-side communication.

Techopedia Explains Socket

Mostly URLs and their connections are used to access the Internet, but sometimes programs require a simple communication link between the program’s client and server side. This role would be associated to a socket which would tie the program’s client and server sides.

When a client establishes communication with the server, for example by querying the database, a reliable server and client connection is established via a TCP communication channel. In this type of communication, the client and server can read or write on sockets tied to specific communication channel.

Sockets are mainly classified into two types: active and passive. Active sockets are connected with the remote active sockets through an open data connection. If this connection is closed, the active sockets at each end point is destroyed. Passive sockets are not connected; instead, they wait for an incoming connection that will spawn a new active socket.

Even though there exists a close relationship between a socket and a port, the socket is not actually a port. Every port may have a single passive socket waiting for incoming connections and several active sockets each respective to an open connection in the port.


Related Terms

Margaret Rouse

Margaret is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.