dpJudas wrote:I don't know why it didn't work before for you, or why Doom might have opted for using multiple UDP ports. But just to help clarify how UDP sockets works: an UDP socket is listening on a single port. Anything the socket sends will have that port as its source port. Anything the computer receives on that port will be received regardless of what the sender IP and port was. If you don't bind a listen port explicitly, the system will pick a free port number the first time you send a message from the socket.
In other words, when you call recvfrom on an UDP socket you'll get the information (IP address and port) about where the message was sent from. You can have multiple other peers sending to your socket where you can use their IP+port for looking up which peer it came from. And you can send messages back to each of those without needing a port for each, by supplying the IP+port of the destination when you call sendto.
now things are starting to make more sense. I have something that seems to run somewhat reliably on a LAN so far, but there's still a lot of testing and the like I need to do to ensure reliably, and then I need to beat the actual netcode into shape to excise all the remaining IPX assumptions.
Also I ended up implementing this with Winsock, since I looked at things like SDL_net and saw there's only like 10 functions I'd be calling in a UDP environment, so I figured it would be easy to roll manually for each platform. Though this was the right choice, it's been slightly annoying since the Winsock documentation is full of holes, missing data, TBDs, and so on. That was fun to deal with...