MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / available

Method available

src/main/java/field/utility/Ports.java:16–25  ·  view source on GitHub ↗
(int port)

Source from the content-addressed store, hash-verified

14 throw new RuntimeException();
15 }
16
17 static public boolean available(int port) {
18 Socket s = null;
19 try {
20 s = new Socket("localhost", port);
21 return false;
22 } catch (IOException e) {
23 return true;
24 } finally {
25 if (s != null) {
26 try {
27 s.close();
28 } catch (IOException e) {

Callers 3

ServerMethod · 0.95
nextAvailableMethod · 0.95
sendAsFixedLengthMethod · 0.80

Calls 2

closeMethod · 0.65
printlnMethod · 0.45

Tested by

no test coverage detected