Refine code.
Refine code.

Use IOException instead of Exception.
Use try-with-resource to ensure socket could be closed.
Add timeout when connect to remote server.

Bestoa/shadowsocks-vertx,bestoa/shadowsocks-java