Added automatic port assignment support. Depends on netstat