Fixed problem with hostname resolve for sockets