The mirroring of https://code.google.com/p/erlang-scoketio/