Re: SDLNet(not getting packs with WAN IP but works fine with LAN
"Timodor" <[email protected]>
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <[email protected]> |
I ended up creating an SDL Net Server on Windows thinking it was Android Limitation. I opened the port on the Windows FireWall and Port Forward the Modem, still no luck.
I have no idea.
IPaddress client::ResolveHost(char* address, int port)
{
IPaddress serverAddress;
/* Resolve server name */
//if (SDLNet_ResolveHost(&serverAddress, address, port)) //WAS 127.0.0.1
if (SDLNet_ResolveHost(&serverAddress, "WAN ADDRESS", 2000)) //WAS 127.0.0.1
{
//fprintf(stderr, "SDLNet_ResolveHost(%s %d): %s\n", argv[1], atoi(argv[2]), SDLNet_GetError());
//exit(EXIT_FAILURE);
}
return serverAddress;
}
This How the Client is setting to Connect, but if the WAN ADDRESS is replaced with LAN Address it works
This is Server Address
IPaddress serverAddress;
/* Resolve server name */
//if (SDLNet_ResolveHost(&serverAddress, address, port)) //WAS 127.0.0.1
if (SDLNet_ResolveHost(&serverAddress, NULL, port)) //WAS 127.0.0.1
{
//fprintf(stderr, "SDLNet_ResolveHost(%s %d): %s\n", argv[1], atoi(argv[2]), SDLNet_GetError());
//exit(EXIT_FAILURE);
}
return serverAddress;
MrOzBarry wrote:
> You might need to open/forward the port on your router.
> On Aug 20, 2016 12:46 AM, "Timodor" <[email protected] ([email protected])> wrote:
> > Hello,
> >
> > I can't seem to access my SDL Server via WAN IP address from the Client. But using a LAN address works perfectly fine.
> > SDL server doesn't receive packets? What might be occurring?
> >
> >
> > _______________________________________________
> > SDL mailing list
> > [email protected] ([email protected])
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> >
> >
>
_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org