Tests listening a port and connection gets accepted.