예제 #1
0
        private int GetMaxSize(int maxPayloadBytes)
        {
            if (!Method.HasContent)
            {
                return(Framing.Method.FrameSize + Method.GetRequiredBufferSize());
            }

            return(Framing.Method.FrameSize + Method.GetRequiredBufferSize() +
                   Framing.Header.FrameSize + Header.GetRequiredPayloadBufferSize() +
                   Framing.BodySegment.FrameSize * GetBodyFrameCount(maxPayloadBytes) + Body.Length);
        }
예제 #2
0
 internal override int GetMinimumPayloadBufferSize()
 {
     // class id (2 bytes) + method id (2 bytes) + arguments (X bytes)
     return(4 + _method.GetRequiredBufferSize());
 }