This site requires JavaScript, please enable it in your browser!
Greenfoot back
qnanqing
qnanqing wrote ...

2012/2/26

Online game work on LAN (WLAN) but not internet?

qnanqing qnanqing

2012/2/26

#
i'm currently working on my multiple online game scenario (the code is very messed up but its work fine :D) i'm using UDP connection, the server clings into port 9321 on my computer (192.168.1.100) the game work on computer on my LAN. But when i change the client to use my internet address (139.195.12.183) , the packet cannot be sent. i've set up my router to forward request on port 9321 to my address and add firewall exception on that port. what's possibly wrong?
iau iau

2012/2/26

#
The way routers work, you can't see your external (WAN) internet address from your internal network (LAN). If that's what you are trying to do, there's nothing wrong, it just won't work. Ian.
qnanqing qnanqing

2012/2/26

#
Aaah i see, glad that there is nothing wrong with the code. so i shouldnt use router if my computer want to be a server. but ive apache web server running and can be accessed via internet, why is that? thanks for the answers
davmac davmac

2012/2/26

#
I think you're misunderstanding. If the client is on the internet, outside the local subnet, it should be able to access your server via the internet facing IP (139.195.12.183) so long as you have correctly configured your router to forward UDP packets. There might be a problem if the client is on the same local subnet though. Also, the router might forward TCP but not UDP packets.
darkmist255 darkmist255

2012/2/26

#
Port forwarding would be required here, it's not an elegant solution but it's the most obvious solution.
qnanqing qnanqing

2012/2/27

#
@davmac ok i will test it by using computer outside my subnet Ok ive tried it using computer outside my subnet. Only the first datagram packet is being sent to my computer. Its just like the application just "block" after that. now i ask my friends to use greenfoot too, to see whats happening ive uploaded the client! http://www.greenfoot.org/scenarios/4238
qnanqing qnanqing

2012/2/27

#
Oh it working now! the program works fine with other computer!!!!!!!
You need to login to post a reply.