Almost everything tested and fixed!

without SSLSockets (tested on normal Sockets) and reading from file