I definitely agree with PeterH there. Also:
inByte = client.read(); // Read the character in the buffer
Try putting a test for client.available() before the read.
I definitely agree with PeterH there. Also:
inByte = client.read(); // Read the character in the buffer
Try putting a test for client.available() before the read.