mirror repo of https://github.com/littlequartz/clink. a socket programming assignment for Sistem Terdistribusi
Go to file
Syahdan cae82f5d55 feat(tui): add TCP client integration and connection status; send input over network
- Add net/bufio/time imports and model fields (conn, server, err)
- initialModel now accepts server address; display it as header
- Init batches textarea.Blink with connectCmd to dial TCP on startup
- Implement connectCmd with 3s timeout; emit [connected]/[disconnected]/error via netMsg
- Spawn scanner goroutine to read lines from conn and forward as netMsg
- Implement sendCmd to write input lines to the connection
- Update: on Enter, send via sendCmd instead of local echo; handle netMsg to append messages and status
- Close connection on Ctrl+C/Esc
- main: start local TCP server in goroutine; delay 200ms; connect to 127.0.0.1:9000
- Minor: append textarea cmd only if non-nil; render server header above viewport
2025-10-15 11:22:52 +07:00
go.mod initial commit 2025-10-15 00:19:34 +07:00
go.sum initial commit 2025-10-15 00:19:34 +07:00
main.go feat(tui): add TCP client integration and connection status; send input over network 2025-10-15 11:22:52 +07:00
server.go initial commit 2025-10-15 00:19:34 +07:00