Listening on sockets allows an application to connect to other devices. We use this technique daily visiting websites, or connecting to a series of services via the HTTP(s) protocol. Go comes with a standard library to manage HTTP connections, but, from time to time, that’s not the most effective way to exchange data between two or more systems. This post will show you how to listen on sockets handling multiple connections.
Multi-threading has always been the novice programmer’s scarecrow, and even professionals might have never really written asynchronous code before, for a number of reasons: first of all because it’s more complicated to think in an asynchronous world! Golang has multi-threading in its heart, and this is a big deal because it simplifies a number of things.