Skip to content

Commit 29bfda3

Browse files
committed
utils: server
1 parent 5567c51 commit 29bfda3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/utils/server.cr

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,19 @@ module MoonScript
3131
end
3232
end
3333
end
34+
end
35+
36+
private def port_closed?(host, port)
37+
client = Socket.tcp(Socket::Family::INET, true)
38+
client.connect(host, port, 0.25)
39+
client.close
40+
true
41+
rescue
42+
false
43+
end
44+
45+
private def terminal
46+
Render::Terminal::STDOUT
47+
end
3448
end
3549
end

0 commit comments

Comments
 (0)