Back in Chapter 8, Processes and Signals, we talked a little about Unix sockets and presented a small Go program that was acting as a Unix socket client. This section will also create a Unix socket server to make things even clearer. However, the Go code of the Unix socket client will be also explained here in more detail and will be enriched with error handling code.
Unix sockets revisited
A Unix socket server
The Unix socket server will act as an Echo server, which means that it will send the received message back to the client. The name of the program will be socketServer.go and it will be presented to you in four parts.
The first part of socketServer.go is the following:
package main import ( "fmt" ...