Solution 1: Working with TCP/IP and WebSocket
Explore how to build concurrent TCP servers in Go that handle multiple client connections using goroutines. Understand how to generate and send data over TCP, and gain foundational knowledge of WebSocket server and client creation. This lesson provides practical code examples to help you develop reliable networked applications using Go's concurrency features.
We'll cover the following...
We'll cover the following...
Solution
Here is the concurrent TCP server (concTCP.go) that generates random numbers in a predefined range of 1–100.
To run the client side, open a new terminal window and copy and paste the command below in it:
nc localhost 1234
The following playground contains the concurrent TCP server (concTCP.go ...