Added support for adjusting ports from the command line.
Added support for controlling a second port.
Fixed a possible buffer overflow, when the network went down.