Can you change this line:
to:
PX4_ERR("error connecting to socket: %s", strerror(errno));
and see what the output is?