• Advertisement
Sign in to follow this  

SDLNet binding incoming connections?

This topic is 3839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK I've built a pretty basic application using SDLNet. This consists of a server application and two clients which are all on my local network. To allow for the server to deal with incoming data from both the clients I have used SDLNet_UDP_Bind with both the network IP's : IPaddress client; SDLNet_ResolveHost(&client, "192.168.1.36", 9998 ); SDLNet_UDP_Bind(sd, 0, &client); SDLNet_ResolveHost(&client, "192.168.1.34", 9998 ); SDLNet_UDP_Bind(sd, 0, &client); This works perfectly as the server can send separate data to both clients. But when reading the SDLNet documentation regarding binding addresses it has me confused : "Incoming packets are only allowed from bound addresses for the socket channel." So how do you deal with new connections assuming you don't know the addresses they will be connecting from? Thankyou in advance, Thom.

Share this post


Link to post
Share on other sites
Advertisement
Oh that makes sense now and its got my program working like I wanted it, thankyou very much!

Just to make sure I'm doing the right thing, I've replaced that piece of code with this :


IPaddress client;

SDLNet_ResolveHost(&client, NULL, 9998 );
SDLNet_UDP_Bind(sd, 0, &client);


Cheers,
Thom.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement