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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -