Added --num to server
Added socket timeout.
Added server tests