Improved TCP-Server/Client functions