static int hasOpenPort_timeout = 5000; static bool hasOpenPort(S ip, int port) { try { Socket socket = new Socket(); socket.connect(new InetSocketAddress(ip, port), hasOpenPort_timeout); socket.close(); true; } catch (Exception ex) { false; } }
Began life as a copy of #1000808
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1011746 |
| Snippet name: | hasOpenPort |
| Eternal ID of this version: | #1011746/2 |
| Text MD5: | 4eab9ed94f8ba3c9d3eb6a04dcf24be0 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-11-05 00:30:00 |
| Source code size: | 280 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 591 / 652 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |