Jump to content
  • Advertisement
Sign in to follow this  
MilfredCubicleX

Server Autodiscovery and the Windows Firewall

This topic is 2702 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

I hate to ask a question concerning a topic that seems so heavily discussed but I can't seem to find a solution to a specific problem of mine. I'm developing a small game (written in Java as an applet, it is client/server based and running over UDP over IPv4) for which I'd like to have an auto-discovery feature for local (i.e., LAN) servers. I have implemented this feature using UDP broadcast messages which was working great until I tested it on some windows machines. The process for my server auto-discovery implementation is as follows: the client begins by sending a broadcast packet with a small message inside (indicating that it is a request for servers). The server, having received the request, sends a unicast message back to the client indicating the name of the server. The problem occurs during the second half of the transaction because the Windows firewall blocks the server's reply to the client (presumably because the client has not yet sent any messages directly to that server). I was looking into using multicast, but according to the Java docs, "Currently applets are not allowed to use multicast sockets.". I'd prefer that clients not have to do any administrative configuration such as disabling the firewall or adding an exception. Is there anyway to get around this? (I want to note that there is no firewall pop-up window asking the user to "Unblock" the game since it's an applet)

Share this post


Link to post
Share on other sites
Advertisement
Windows should not be blocking it, in fact, it couldn't be if you are listening on that port (because it will ask you whether you want to allow or block network activity to that specific program and insert an exception into the firewall). You must be listening on the port the other server is sending to.

The only other possibility is that you blocked the program by accident when the windows firewall dialog came up. So now, when you start the program, the firewall remembers not to allow that program access.

Share this post


Link to post
Share on other sites

working great until I tested it on some windows machines. The process for my server auto-discovery implementation is as follows: the client begins by sending a broadcast packet with a small message inside (indicating that it is a request for servers). The server, having received the request, sends a unicast message back to the client indicating the name of the server. The problem occurs during the second half of the


You have to bind to the port that the response will be coming on. This may show an automated Windows Firewall dialog box asking whether the program should be allowed, and traffic will not be allowed until the user okays it.
Also, you generally want to install a firewall rule as part of your installer program on Windows (I think the interface is called something like IFwAdmin). Java Applets are not the most optimized host for Windows apps. (In fact, a Silverlight app would probably work better :-)

Share this post


Link to post
Share on other sites
Binding to the port causes the firewall dialog to come up so now it works, thanks guys.

My main motivation to use Java was that it would minimize the work on the part of the user (compared to an executable installer (assuming Java is already installed, of course)). I actually didn't even think to try Silverlight.

Thanks again

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!