$localports and $remoteports can me left undef if $listening is not set