Fixed Two issues in connection.cpp

Fixed: Socket options must be set after socket is opened. Fixed: host pa...