サーバのテストをするときなどに未使用のポートを使ってテストコードを走らせたい、というときがあって、PerlだとTest::TCPにempty_portというのがあって簡単に取得出来る。 $ perl -MTest::TCP -E 'say Test::TCP::empty_port' 10256引数を与えない場合は毎回違う値になるけれど、基本的に必ず空いているポート番号が返ってくる。 nodeでも同じようなのがあればいいな、と思ったのだけど多分ないのでTest::TCPを参考に自分で書いてみた。 exports.empty_port = function(callback) { port = 10000 + Math.floor(Math.random() * 1000); var net = require('net'); var socket = new net.Socket(); v
Twitter Util A bunch of idiomatic, small, general purpose tools. See the Scaladoc here or check out the user guide. Status This project is used in production at Twitter (and many other organizations), and is being actively developed and maintained. Releases Releases are done on an approximately monthly schedule. While semver is not followed, the changelogs are detailed and include sections on publ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く