On 06/07/2010 02:25 PM, Jeremy Custenborder wrote:
This will be my last question for at least the next day or two. :) I just
want to double check my interpretation of the message framing.

Framing is mostly orthogonal to payload structure. It just says that the bytes that make up a payload are broken into length-prefixed frames. Those frames may or may not align with the payload's structure. When they do line up, optimizations are possible, so implementations should try to line them up when sending largish binary objects.

Request payloads are of the form <metadata><messageName><parameters> and response payloads are of the form <metadata><boolean><errorOrResponse>. These may be delivered in one or more frames. A good framing might be to use a single frame unless a parameter has a bytes value that's larger than 4k, in which case that buffer might be transmitted as a distinct frame, so that it can be potentially processed in zerocopy style. I.e., if it contains file data, then the sendfile system call could be used to copy data from file to socket.

Does that help?

Doug

Reply via email to