Some defines cleanup.
Added check for number of currently accepting sockets on each port.