Understanding Socket Connections in Computer Networking

Lucas PenzeyMoog
The Startup
Published in
4 min readMay 24, 2019

--

Photo by Neven Krcmarek on Unsplash

I’m currently in the beginning stages of building an HTTP server in Java, but before getting too far into the implementation, I wanted to cement my understanding of software sockets and what role they play in the client/server relationship.

Like most software terms, a socket is an abstraction of the type of physical socket (like the one pictured above) that we’re all familiar with. A physical socket is an entry point for a power cable. A software socket is also an entry point, but instead of accepting a power cable, it accepts a network connection from another computer.

The very earliest computers had no need for such sockets, because computer networking wasn’t yet a thing. Computers were simply standalone machines that ran processes but couldn’t communicate with other computers. Then systems like arpanet, ethernet, and internet came along to bring us to where we are today, with billions of computing devices all connected to one another from across the globe. But with all those devices talking to one another, how does it all stay organized? The full answer, as usual, is beyond the scope of this post, but the short answer is that sockets play a key role in keeping all these communications neat and tidy.

To understand sockets we first need to explore related technologies that make sockets possible: IP…

--

--