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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -