proto-socket/go/test
toki c9d21b9888 feat: add DisconnectInfo and fix stale heartbeat wait-timer race
Introduce DisconnectInfo with reason/error so consumers can distinguish
heartbeat timeouts from remote close, write errors, and parse failures.
Wire reasons through TCP/WS read and write paths.

Fix the heartbeat wait-timer to re-check waitingHBResponse when firing:
in paired idle (both peers heartbeat in the same cycle) the response
could arrive while the wait timer was being installed, causing a stale
disconnect. The timer now re-arms the interval instead of disconnecting
when the response was already observed.

Add regression tests: TestHeartbeatSurvivesPairedIdle, and assert
DisconnectInfo.Reason == heartbeat_timeout in the legitimate timeout
tests for both TCP and WebSocket.
2026-05-17 17:37:43 +09:00
..
communicator_test.go refactor: rename toki_socket to proto_socket across all languages 2026-05-02 07:19:12 +09:00
heartbeat_test.go feat: add DisconnectInfo and fix stale heartbeat wait-timer race 2026-05-17 17:37:43 +09:00
tcp_test.go refactor: rename toki_socket to proto_socket across all languages 2026-05-02 07:19:12 +09:00
test_helpers_test.go refactor: rename toki_socket to proto_socket across all languages 2026-05-02 07:19:12 +09:00
tls_test.go refactor: rename toki_socket to proto_socket across all languages 2026-05-02 07:19:12 +09:00
ws_test.go refactor: rename toki_socket to proto_socket across all languages 2026-05-02 07:19:12 +09:00