Jump to content

SimTX API/Packets/Ping: Difference between revisions

From SimTX Wiki
Clanker (talk | contribs)
Protocol v25 reference
 
Clanker (talk | contribs)
Remove development history and server internals
 
Line 35: Line 35:


== Example ==
== Example ==
Complete frames, including the varint length prefix, from the protocol's golden test vectors (<code>protocol/simtx/v25/testdata/frames.json</code>).
Complete frames, including the varint length prefix.


'''<code>ping</code>''' (client to server, 12 bytes):
'''<code>ping</code>''' (client to server, 12 bytes):

Latest revision as of 17:16, 24 October 2026

Ping
Frame ClientFrame, field 2
Member ping
Direction Client → server
Session All roles
Roles All roles, any time after the hello.
Permission None
Answered by Pong
Answers
Defined in frames.proto

Ping asks the server for a Pong. Use it to measure the round-trip time, to estimate the offset between the client and server clocks, or to check that an otherwise idle connection is alive.

Definition[edit | edit source]

message Ping { int64 nonce = 1; int64 client_time_ms = 2; }

Fields[edit | edit source]

# Field Type Description
1 nonce int64 Any value chosen by the client; echoed in the Pong.
2 client_time_ms int64 Client clock when sent, Unix ms; echoed.

Behaviour[edit | edit source]

  • Every role accepts it at any time after the ServerHello.
  • The server answers each ping with one pong. Pongs can arrive between any other frames, so match them by nonce.
  • Pings are cheap, but there is no reason to send more than one every few seconds.

Example[edit | edit source]

Complete frames, including the varint length prefix.

ping (client to server, 12 bytes):

0B                      frame length 11
12 09                   ping (Ping), 9 bytes
  08 63                 nonce = 99
  10 80 94 83 B9 97 34  client_time_ms = 1793000000000

See also[edit | edit source]

SimTX API reference (protocol v25)
Start OverviewQuick startFramingData typesPacket listSchemaLimits and errorsCompatibility and versioning
Account service OverviewDevice loginServer directoryStation endpointsGame ticketsPermissionsPublic endpoints
Game protocol Connection and handshakeSession statusReceiver sessionTransmitter sessionControl sessionCatalogModeration
Stations StationsSatellitesTracking and pointing
Connection ClientHelloPingServerHelloPongErrorBanner
Session AntennaPointingUpdateSessionStatus
Receiver ForwardedClientAddressReceiverStartReceiverRetuneIqStreamDescriptorIqBlock
Transmitter TransmitterStartSampleBlockTxUpdateTxModeInfoTxQueueTxAcceptTxTelemetryTxUpdateAck
Control ListStationsStartMonitorStopMonitorWeatherMapRequestServerHealthRequestCoverageMapRequestEphemerisRequestPassPredictionRequestStationListMonitorBlockMonitorEndWeatherMapResponseServerHealthReportCoverageMapResponseEphemerisResponsePassPredictionResponseMonitorAck
Catalog CatalogListRequestCatalogFetchCatalogUploadCatalogDeleteCatalogListCatalogEntryCatalogUploadResultCatalogDeleteResult
Moderation KickRequestIpModerationRequestBroadcastBannerKickResultIpModerationResultStationImpactList
Archive Protocol v24 reference