SDL_net: How to SDLNet_UDP_Send() to localhost only?

Hi there,
I’m using SDL_net to send UDP broadcast messages. The servers on localhost and remote machine are running fine.

I want the program to send to the localhost only when the user only wants to run a local server. I’m using the host address 0xffffffff for broadcast. I changed it to 0x7f000001 (127.0.0.1) and hoped it will send to one machine only. But it didn’t work.
Do I misunderstand something? What do I have to do?

Thanks,
Phuoc

Hi.

The addresses are in big endian, or “network byte order”. Try using
SDLNet_ResolveHost() with “127.0.0.1” or “localhost” rather than
obscure constants.

HTH
– BrianOn 21 November 2010 12:21, Phuoc Can Hua wrote:

Hi there,
I’m using SDL_net to send UDP broadcast messages. The servers on localhost and remote machine are running fine.

I want the program to send to the localhost only when the user only wants to run a local server. I’m using the host address 0xffffffff for broadcast. I changed it to 0x7f000001 (127.0.0.1) and hoped it will send to one machine only. But it didn’t work.
Do I misunderstand something? What do I have to do?