Skip to content

Phase 2: Slice 1 — Ping (handshake + Ping/Reply) #3

Description

@TomiCheng

Goal

First slice of real client connectivity: connect to a Geode server, complete the handshake, send a Ping, receive a Reply. Walking-skeleton end-to-end.

Done when

  • A TcpConnection class wraps TcpClient + NetworkStream and exposes a SendFrameAsync / ReceiveFrameAsync pair built on Phase 1's frame codec.
  • Handshake follows the ad-hoc byte sequence in cppcache/src/TcrConnection.cpp::sendHandshakeForServer. Re-implement byte-by-byte from the C++ source — do not paraphrase.
  • PingAsync() sends a Ping (5) frame and awaits a Reply (6) frame.
  • Integration test (Testcontainers) connects to the Geode container started by GeodeFixture and gets a real Reply.

Tasks

  • src/Geode.Client/Transport/TcpConnection.cs
  • src/Geode.Client/Transport/Handshake.cs
  • src/Geode.Client/Transport/ClientProxyMembershipID.cs (host / PID / UUID / durable id)
  • src/Geode.Client/Operations/PingOperation.cs
  • tests/Geode.Client.Tests/Transport/HandshakeBytesTests.cs (golden bytes)
  • tests/Geode.Client.IntegrationTests/PingTests.cs

References

  • cppcache/src/TcrConnection.cppsendHandshakeForServer, readHandshakeAck
  • cppcache/src/HandShake.cpp / .hpp
  • CLAUDE.md → "Handshake(最容易踩雷的一段)"

Out of scope

  • Connection pool (Phase 6) — single connection only.
  • Locator discovery (Phase 7) — server endpoint must be configured directly.
  • TLS (Phase 8).
  • Authentication (Phase 9) — anonymous only.

Branch

feat/phase-2-ping

Note

This is the protocol-correctness gauntlet. Expect to iterate. Capture bytes with Wireshark on the loopback interface if the server rejects the handshake — the diff between what we send and what the Java client sends is usually one byte off in ClientProxyMembershipID.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions