I tried changing the readrawdata command in both the server and the client socket writes/reads to write and read commands directly on the socket. This does not seem to have made a difference.