Added host name resolution and small fix fort port number (missing htons() )