In the modern world, people tend to use massive frameworks to accomplish simple tasks.
Nothing quite like swatting a fly with a nuclear missile when you load up 100 megs of runtime just to execute
ping and post the result to a database.
But sometimes, when you’re writing a utility, you want it to be quick and lightweight.
And if you’re going through the effort, you might as well see about making it portable.
Every extent Unix system uses BSD sockets for their networking layer, which traces back to 1983 and the release of 4.2BSD.
In this model, network connections (“sockets”) are full fledged kernel objects that built on top of the existing Unix API (e.g.
Additional system calls were introduced both to create new sockets (e.g.
socket) as well as provide networking-related operations (e.g.
By comparison, the original version of WinSock was a completely user space affair with its own API, loosely modeled on BSD sockets, but distinct from the system’s native interface. As the interface transitioned into the 32-Bit era with WinSock 2, it began to integrate more closely into the Win32 API. While Microsoft has written some material on porting Unix applications to WinSock, it leaves unanswered the question as to how to portably target both platforms.