add max frame size checking on first stage of reading from socket