GameNetworkingSockets: Timeout on connect while retrieving routes/connecting

Hi,

Apologies if this isn’t the correct place for a report (I’m using SteamNetworkingMessages from the Steamworks SDK).

I’ve been working on a small shim that can replace the older SteamNetworking API for legacy games and I’ve run into an issue setting up a symmetric connection between two clients.

For the handshake, each client initiates a connection to each other (there’s a matchmaking server instructing them to start sending packets). This appears to start fine but quickly results in a timeout shown below:

client 1

[2021-05-19 01:22:19.569] [modengine] [warning] Steam: Messages session steamid:76561198216541595: created
[2021-05-19 01:22:19.570] [modengine] [warning] Steam: [#3971098875 P2P steamid:76561198216541595] Our cert expires in 165312 seconds.
[2021-05-19 01:22:19.572] [modengine] [warning] Steam: [#3971098875 P2P steamid:76561198216541595] Created connection for messages session
[2021-05-19 01:22:20.317] [modengine] [warning] Steam: [#3971098875 P2P steamid:76561198216541595] Received P2P routes ack for revision 0 (latest revision is 1).
[2021-05-19 01:22:20.857] [modengine] [warning] Steam: [#3971098875 P2P steamid:76561198216541595] Received P2P routes ack for revision 0 (latest revision is 1).
[2021-05-19 01:22:21.314] [modengine] [warning] Steam: [#3971098875 P2P steamid:76561198216541595] Received P2P routes ack for revision 0 (latest revision is 1).
[2021-05-19 01:22:21.808] [modengine] [warning] Steam: [#3971098875 P2P steamid:76561198216541595] Received P2P routes ack for revision 0 (latest revision is 1).
... snip ...
[2021-05-19 01:22:29.570] [modengine] [warning] Steam: [#3971098875 P2P steamid:76561198216541595] problem detected locally (5003): App did not respond to Messages session request in time, discarding.

client 2

[2021-05-19 01:22:22.236] [modengine] [warning] Steam: Destroying relay 'sof#5 (139.45.193.10:27019)' because initial_ping_timeout
[2021-05-19 01:22:22.237] [modengine] [warning] Steam: Destroying relay 'eat#38 (155.133.235.18:27052)' because initial_ping_timeout
[2021-05-19 01:22:24.840] [modengine] [warning] Steam: Destroying relay 'sof#2 (139.45.193.10:27016)' because initial_ping_timeout
[2021-05-19 01:22:24.841] [modengine] [warning] Steam: Destroying relay 'eat#58 (155.133.235.34:27034)' because initial_ping_timeout
[2021-05-19 01:22:27.441] [modengine] [warning] Steam: Destroying relay 'sof#1 (139.45.193.10:27015)' because initial_ping_timeout
[2021-05-19 01:22:27.442] [modengine] [warning] Steam: Destroying relay 'eat#37 (155.133.235.18:27051)' because initial_ping_timeout
[2021-05-19 01:22:29.565] [modengine] [warning] Steam: [#3644006119 P2P steamid:76561199104113068] problem detected locally (5003): Timed out attempting to connect
[2021-05-19 01:22:29.567] [modengine] [warning] Steam: [#3644006119 P2P steamid:76561199104113068] messages session problem detected locally: 5003 Timed out attempting to connect

For some additional context, the clients send each other packets at approximately the same time before either has set up a session: client 1

[2021-05-19 01:22:19.562] [modengine] [info] Sending packet to 11000010f46759b

client 2

[2021-05-19 01:22:19.557] [modengine] [info] Sending packet to 1100001442db9ac

I have checked to see if the issue is simply that I’m not responding with AcceptSessionWithUser(...) when a messages session request comes in, but I’ve added some logging here and that callback is never invoked: https://github.com/garyttierney/ds3patch/blob/feat/ci/src/modengine_extension/p2p_session_manager.cpp#L106-L108

The only thing that really stands out to me is the ACKs for revision 0 of the routes while the latest is revision 1, but I’m not sure if that’s of any importance and have little experience with the GameNetworkingSockets code so may just be a red herring. I’m also looking at the code here: https://github.com/ValveSoftware/GameNetworkingSockets/blob/f98cd32f62877d31a3fe27fc91578e13f4f795c9/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_connections.cpp#L2975 and there’s a lot of logging that isn’t present in my logs (filtering at k_ESteamNetworkingSocketsDebugOutputType_Everything), so maybe it’s something more fundamentally wrong with how I’m setting this up.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Yes, to access the SDR relay network and the Steam signaling backend, you have to be using the Steamworks SDK.

The P2P code (including the symmetric connect mode) should work if you provide your own signaling. There is a P2P unit test in this codebase. It does not currently exercise the custom signaling. I should add a test case for this. It doesn’t use SDR, so it will fail if NAT punch fails or if there is no TURN server configured.

BTW, it possible to define STEAMNETWORKINGSOCKETS_STANDALONELIB and link with the Steamworks SDK but get these interfaces from the standalone library. In fact, you can define both of them and then select at runtime which code to use. (Dota and CSGO do this.)