Remove unused parameter
Improve tests and change some defult sizes
Do not block forever waiting for handshake
Make server test resilient