1 | static int hasOpenPort_timeout = 5000; |
2 | static bool hasOpenPort(S ip, int port) { |
3 | try { |
4 | Socket socket = new Socket(); |
5 | socket.connect(new InetSocketAddress(ip, port), hasOpenPort_timeout); |
6 | socket.close(); |
7 | true; |
8 | } catch (Exception ex) { |
9 | false; |
10 | } |
11 | } |
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: | 395 / 445 |
Version history: | 1 change(s) |
Referenced in: | [show references] |