This is a simple TCP echo server written in Go. The server listens for incoming TCP connections on a specified port, receives data from the client, and sends the same data back to the client. This is commonly referred to as an "echo" server because it echoes back the input it receives.
- Listens for incoming TCP connections on port 20080.
- Handles multiple clients concurrently using Goroutines.
- Echoes received data back to the client.
- Gracefully handles client disconnections and unexpected errors.
To use this TCP echo server, you need to have Go installed on your system.
(if applicable) or create a new file with the provided code.
go build -o echoServer
./echoServer
The server will start listening on 0.0.0.0:20080.
You can use tools like telnet or nc (Netcat) to connect to the server and test its functionality:
telnet localhost 20080
Or:
nc localhost 20080
Type any text, and the server will echo it back to you.
Feel free to open an issue or submit a pull request if you have any suggestions or improvements.