Exercise 3: Working with TCP/IP and WebSocket

Let's test our understanding by attempting this challenge.

We'll cover the following

Let’s practice what we’ve learned so far. The solution to this exercise will be provided in the next lesson.

Problem

Add UNIX signal processing to the concurrent TCP server (concTCP.go) developed in this chapter to gracefully stop the server process when a given signal is received.

Note: To add UNIX signal processing to the concurrent TCP server concTCP.go, we need to handle the SIGINT signal (which is sent to a process when the user presses “Ctrl + C” in the terminal running the server) and gracefully shut down the server when this signal is received.

To run the client side for the concTCP.go TCP server, open a new terminal window and copy and paste the below command into it:

Get hands-on with 1400+ tech skills courses.