mirror repo of https://github.com/littlequartz/clink. a socket programming assignment for Sistem Terdistribusi
Go to file
Syahdan aee33003bf refactor(net): reuse a single buffered reader; manage broadcast loop lifecycle
Client:
- Keep a persistent bufio.Reader on the connection (model.reader)
- On connect, initialize reader and drain initial greetings with deadlines
- Pass reader into fetchMenuCmd, submitOrderCmd, and listenForBroadcastsCmd
- Avoid starting duplicate broadcast listeners with broadcastListening flag
- Start broadcast listener after menu is loaded and form is initialized
- Update commands to read via shared reader instead of creating new ones
- Remove greeting drain from connectCmd (now handled on connectedMsg)
- Minor: small flow tweaks for opening form and handling reconnection

Benefits:
- Prevents interleaved reads from multiple readers on the same net.Conn
- Reduces race conditions and broken protocol reads
- Ensures a single, continuous read loop for broadcasts and responses
2025-10-16 12:48:42 +07:00
.github/workflows ci: fix artifact path 2025-10-15 13:06:10 +07:00
.gitignore chore: gitignore to ignore dist folder 2025-10-15 20:34:09 +07:00
AGENTS.md feat(order-console): add pricing, recent order feed, and responsive layout; extend protocol 2025-10-16 12:47:38 +07:00
build.sh chore: gitignore to ignore dist folder 2025-10-15 20:34:09 +07:00
go.mod chore: gitignore to ignore dist folder 2025-10-15 20:34:09 +07:00
go.sum chore: gitignore to ignore dist folder 2025-10-15 20:34:09 +07:00
main.go refactor(net): reuse a single buffered reader; manage broadcast loop lifecycle 2025-10-16 12:48:42 +07:00
server.go feat(order-console): add pricing, recent order feed, and responsive layout; extend protocol 2025-10-16 12:47:38 +07:00