public RpceCoRequestPdu CreateCoRequestPdu(
            RpceServerSessionContext sessionContext,
            ushort opnum,
            uint callId,
            byte[] stub)
        {
            if (sessionContext == null)
            {
                throw new ArgumentNullException("sessionContext");
            }

            if (stub == null)
            {
                stub = new byte[0];
            }

            RpceCoRequestPdu requestPdu = new RpceCoRequestPdu(sessionContext);

            requestPdu.rpc_vers = sessionContext.RpcVersionMajor;
            requestPdu.rpc_vers_minor = sessionContext.RpcVersionMinor;
            requestPdu.PTYPE = RpcePacketType.Request;
            requestPdu.pfc_flags = RpceUtility.GeneratePfcFlags(sessionContext, RpcePacketType.Request);
            requestPdu.packed_drep.dataRepFormat = sessionContext.PackedDataRepresentationFormat;
            requestPdu.packed_drep.reserved = 0;
            requestPdu.call_id = callId;

            requestPdu.alloc_hint = (uint)stub.Length;
            requestPdu.p_cont_id = sessionContext.ContextIdentifier;
            requestPdu.opnum = opnum;
            requestPdu.stub = stub;

            requestPdu.AppendAuthenticationVerifier();
            requestPdu.SetLength();

            return requestPdu;
        }
        /// <summary>
        /// Create a RpceCoRequestPdu.
        /// </summary>
        /// <param name="opnum">
        /// Opnum of a method.
        /// </param>
        /// <param name="stub">
        /// Request stub.
        /// </param>
        /// <returns>
        /// Created RpceCoRequestPdu, it's ok to be sent out if there's 
        /// no modification to any field of the PDU.
        /// </returns>
        public RpceCoRequestPdu CreateCoRequestPdu(
            ushort opnum,
            byte[] stub)
        {
            if (stub == null)
            {
                stub = new byte[0];
            }

            RpceCoRequestPdu requestPdu = new RpceCoRequestPdu(context);

            requestPdu.rpc_vers = context.RpcVersionMajor;
            requestPdu.rpc_vers_minor = context.RpcVersionMinor;
            requestPdu.PTYPE = RpcePacketType.Request;
            requestPdu.pfc_flags = RpceUtility.GeneratePfcFlags(context, RpcePacketType.Request);
            requestPdu.packed_drep.dataRepFormat = context.PackedDataRepresentationFormat;
            requestPdu.packed_drep.reserved = 0;
            requestPdu.call_id = ComputeNextCallId();

            requestPdu.alloc_hint = (uint)stub.Length;
            requestPdu.p_cont_id = context.ContextIdentifier;
            requestPdu.opnum = opnum;
            requestPdu.stub = stub;

            requestPdu.AppendAuthenticationVerifier();
            requestPdu.SetLength();

            return requestPdu;
        }