Giter Club home page Giter Club logo

Comments (2)

maxweisel avatar maxweisel commented on June 26, 2024

I did some more digging. The address I'm passing to netcode_generate_connect_token is one I generated by using netcode_server_get_port, which gets the port from server->socket_holder instead of server->address.

Is there a recommended way to update netcode's server->address to include the port that was assigned by the system?

from netcode.

maxweisel avatar maxweisel commented on June 26, 2024

@armandgray heyo, I'm currently trying to debug this issue, and I've run into a roadblock related to your ipv4 + ipv6 PR #60

The bug seems to occur here: https://github.com/networkprotocol/netcode.io/blob/master/netcode.c#L3898

In short, if you bind to port 0, the socket gets assigned a port correctly, but the server->address field is not updated and stays with a port of zero. Incoming connection requests (which have the correct port) all fail because the port on their address (the system assigned port) doesn't match the one in server->address (port 0).

I was going to just take the system assigned port from one of the sockets in the socket holder and update server->address.port, but I imagine that won't work if you have an ipv4 and ipv6 socket on different ports. I think the right approach is to ditch server->address entirely and reference the sockets in socket_holder directly.

That said, I'm not 100% if that's the best approach. Would love your feedback.

Max

from netcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.