Add host validation.
Improve connection::open().
Add unit test about connection::close().
Add unit test about connection::__construct().
Catch exception throwed by socket in connection.