Moved HEADER_LENGTH and CHUNK_LENGTH to Server as a parameter.