Skip to content

TCP-Server is a lightweight, interactive TCP server and CLI client built in Go for command parsing, real-time responses, and network communication experiments.

License

Notifications You must be signed in to change notification settings

piyushdev04/tcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TCP-Server

TCP-Server is a lightweight, interactive TCP server and CLI client built in Go.
It supports real-time communication, command parsing, and basic metrics — ideal for learning, testing, or building network-based tools.

alt text


Features

  • TCP communication over localhost
  • Interactive command parsing (PING, ECHO, TIME, EXIT)
  • CLI-based REPL client with custom prompt
  • Server-side metrics (connections, bytes, commands)
  • Console + file logging (logs/server.log)
  • Handles multiple clients concurrently

Metrics & Logging

  • Every 30 seconds, the server prints:

    • Total connections

    • Bytes received

    • Commands handled

  • Logs are written to:

    • Console ([INFO], [ERROR])

    • logs/server.log file


Commands Overview

CLI Command Action
connect <ip:port> Connect to server (e.g. 127.0.0.1:8080)
ping Server replies with PONG
time Server replies with current time
send <message> Echo message back from server
exit Disconnect and quit client

THANKS FOR READING!🍁

About

TCP-Server is a lightweight, interactive TCP server and CLI client built in Go for command parsing, real-time responses, and network communication experiments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages