Switch from fsockopen() to stream_socket_client().
Additionally, allow each server to specify its own port.