When following nakama-godot/README.md at master · heroiclabs/nakama-godot · GitHub Everything works up until joining the match in progress.
I create a client, make a socket, and can send and receive messages fine as I can create a matchmaking request and even get accepted.
public override async Task StartNormalMatchSearch()
{
if (_ticket != null)
return;
var stringProperties = new Dictionary<string, string>()
{
{"game_mode", "normal_match"},
};
_socket.ReceivedMatchmakerMatched += OnMatchmakerMatched;
_socket.ReceivedMatchPresence += SocketOnReceivedMatchPresence;
_socket.ReceivedMatchState += SocketOnReceivedMatchState;
_ticket = await _socket.AddMatchmakerAsync(minCount: 2, maxCount: 2, stringProperties: stringProperties);
}
On the server I can see these logs going through and being accepted, finding a match, and then having the players join. On the client I listen for this and call JoinMatchAsync
private async void OnMatchmakerMatched(IMatchmakerMatched match)
{
try
{
_match = await _socket.JoinMatchAsync(match);
}
catch (Exception e)
{
Logger.Error("failed to join match", e.Message);
return;
}
Logger.Info("match joined");
}
However _match = await _socket.JoinMatchAsync(match);
never returns and instead the log message in godot is Error: failed to join match A task was canceled
.
On the server I can see it trying to reach out to the client and inform it that its joined
server-nakama-1 | {"level":"debug","ts":"2025-04-20T22:10:31.294Z","caller":"server/pipeline.go:65","msg":"Received *rtapi.Envelope_MatchJoin message","uid":"75e20a48-6795-43a2-91d1-45b5d1ec3373","sid":"3cdd158b-1e34-11f0-8b26-7106fdcb5b46","cid":"2","message":{"MatchJoin":{"Id":{"MatchId":"61596192-f02c-4729-b775-1b377a0541e5.nakama1"}}}}
This however eventually results in an i/o timeout
server-nakama-1 | {"level":"debug","ts":"2025-04-20T22:10:55.683Z","caller":"server/session_ws.go:206","msg":"Error reading message from client","uid":"75e20a48-6795-43a2-91d1-45b5d1ec3373","sid":"3cdd158b-1e34-11f0-8b26-7106fdcb5b46","error":"read tcp 172.22.0.4:7350->172.22.0.1:37276: i/o timeout"}
I have combed through documentation, the forum, github issues, etc and have found 0 info on the above issue and all I’ve been able to find is people saying a similar issue with no resolution or generic responses that don’t help.
Does anyone have any idea what’s going on? My next idea is to stop using the Godot websocket adapter but I’d like to keep it since it’s very useful due to being able to make regular calls from async threads without using deferred.