Skip to content

Conversation

@bhushan-mdn
Copy link
Contributor

Hello,

This Pull Request introduces a focused implementation for a basic TCP Server, directly addressing Issue #619 and incorporating the feedback provided in the review of PR #631.

The goal is to provide the simplest, most educational example of network programming with the net package for beginners.

Implementation Details

  • Simplicity and Focus: The example consists of a single server implementation (tcp-server.go) that handles concurrent connections using goroutines.
  • Testing: Aligned with project suggestions, the accompanying script (tcp-server.sh) uses the standard system utility netcat (nc) for testing the connection and response cycle.

Request for Input on Scope

Before I submit further networking examples, I would appreciate guidance on the overall scope:

  1. Is this sufficient? Should we merge this minimal TCP Server example now?
  2. Should I expand the set? Would you prefer a consolidated approach in a single future PR that adds other primitives (e.g., TCP Client, UDP Server/Client)?

Thank you for your time and review!

Copy link
Collaborator

@eliben eliben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thank you. Let's get it reviewed and submitted first, and then a TCP client sample can be added separately

@bhushan-mdn
Copy link
Contributor Author

Hi @eliben ,

I've pushed the requested changes:

  • Simplified the comments around listener.Accept() & handleConnection and the main loop to focus on purpose rather than implementation (removed goroutine mention).
  • Removed unnecessary comment above log.

Please let me know if it looks good. Thanks again for the feedback!

@eliben
Copy link
Collaborator

eliben commented Nov 19, 2025

Thank you, this is sufficiently close. Will merge and adjust locally

@eliben eliben merged commit fc55ea2 into mmcgrana:master Nov 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants