windows - How can my java app detect if its being blocked by firewall -


i have created application desktop using java works server , accepts incoming connections using serversocket . software works on lan , needs allowed firewall. how can check within app if being blocked pc's firewall ?

you can try connect reliable site eg stackoverflow.com

   try {         new socket("stackoverflow.com", 80);     } catch (ioexception e) {         // wrong, not firewall problem         ...      }      // no firewall  

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -