mirror repo of https://github.com/littlequartz/clink. a socket programming assignment for Sistem Terdistribusi
- Introduce typed msgs: connectedMsg, disconnectedMsg, errorMsg, and netMsg - connectCmd now returns connectedMsg on success instead of “[connected]” - Add readLineCmd to read a single line via bufio.Reader and emit netMsg - Handles io.EOF as disconnectedMsg; reports other errors as “[error] read: …” - Update loop: - On connectedMsg: store conn, append “[connected]”, schedule first readLineCmd - On netMsg: append message, schedule next readLineCmd unless it’s a read error - On disconnectedMsg: append “[disconnected]”, close and clear conn - UI tweaks: textarea placeholder uses "..." and height reduced from 3 to 2 - Window sizing: set viewport width; removed old netMsg branch now superseded by typed msgs This removes the scanner goroutine pattern in favor of Cmd-driven incremental reads. |
||
|---|---|---|
| go.mod | ||
| go.sum | ||
| main.go | ||
| server.go | ||