ISteamNetworkingSockets: Trying to use over 8 network lanes/channels fails

Aperta
#455 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@jpggvilaca ci sta già lavorando.

Dal 23/10/2026.

  • #457 di @jpggvilaca — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
networking

Direzione di ricerca

Read GetLane() in src/steamnetworkingsockets/clientlib/steamnetworkingsockets_snp.cpp, focusing on how SerializeVarInt() encodes lane IDs and how m_cbHdr is calculated. Reproduce the failure with more than eight lanes, then check whether the header length and connection behavior are correct after the reported change.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hello! We're pivoting our Godot project's network services to Steam's, using ISteamNetworkingSockets via GodotSteam (GodotSteam versions 4.17.1 and 4.23, if relevant) instead of EOS.

We'd split our traffic into 21 channels while using EOS to get around another issue we were having, but found when migrating to Steam that Steam appears to only support 8 - if you try to use more than 8 channels/lanes, you'll get a message like:

Steam connection 2199661473 status changed: 3 -> 4. End reason: 5002 (SNP decode unreliable msgnum underflow. 0 mod 10000, highest seen 0). Remote: 76561198127298424. Description: #2199661473 P2P ICE steamid:76561198127298424 vport 41500

30.300396825394, peer 1: Client left: 704154296

After some research (I assumed it was my code first, then GodotSteam's second, I now see this in GetLane() in src/steamnetworkingsockets/clientlib/steamnetworkingsockets_snp.cpp (main branch as of this writing):

// Get a conservative size for the header we will need to select the specified lane.
	// This assumes the lanes will be encoded in order.
	if ( nLaneID == 0 ) // Lane zero is the default
	{
		Assert( m_idxLane0 == -1 );
		pNewLane->m_cbHdr = 0;
		m_idxLane0 = len( m_vecLanes )-1;
	}
	else
	{
		if ( nLaneID <= 7 )
		{
			pNewLane->m_cbHdr = 1;
			pNewLane->m_hdr[0] = (uint8)( 0x87 + nLaneID );
		} else {
			pNewLane->m_hdr[0] = 0x8f;
			uint8 *p = SerializeVarInt( &pNewLane->m_hdr[1], (unsigned)nLaneID );
			pNewLane->m_cbHdr = p - &pNewLane->m_hdr[1];
		}
		m_cbRemainingForSegments -= pNewLane->m_cbHdr;
	}

Specifically, if I'm reading it right, this line may be in error:

pNewLane->m_cbHdr = p - &pNewLane->m_hdr[1];

It looks like this logic is trying to put the number of bytes for the lane being used into pNewLane->m_cbHdr - so for 8 lanes, this ought to be 2 bytes, but the above logic will return 1, and the connection will fail with the above error. I think that line should read:

pNewLane->m_cbHdr = p - &pNewLane->m_hdr[0];

Sorry if this isn't the right place to report this! Also happy to be wrong if I'm misreading how that works. Thanks!

Lingua principale
C++
Stelle
10k
Fork
767
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ValveSoftware/GameNetworkingSockets

Tutte le issue di ValveSoftware/GameNetworkingSockets

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.