mirror of
https://github.com/luxfi/zap.git
synced 2026-10-30 15:04:16 +00:00
Two defects made the canonical zapclient native-TCP path non-functional (undetected — no test did a real Client→Server TCP round-trip; zapweb works via Dispatch, inter-shard uses raw zap.Node): 1. Server.Register bound the node handler under the full opcode, but the Node routes inbound by Flags()>>8 (the high byte). Mismatch → handler never found → call hung. Register now uses op>>8; dispatch still reads the full Flags() to select the procedure. 2. Connect with a static Discovery set the node NoDiscovery, so it never learned peer addresses and could not dial. Added WithStaticPeers + a static Discovery, ConnectDirectID (returns the handshake-learned NodeID), and client-side dial-by-address (memoized) so static peers (placeholder NodeID + real Address — the cloud/K8s Service-DNS path) are reachable. mDNS path unchanged. Adds TestNativeTCPRoundTrip as the regression guard.