buffsize increased to 4096, server connection put in a while loop, connection shutdown is added for read operations