当前位置: 首页>>代码示例>>C#>>正文


C# org.xdrEncodeIntVector方法代码示例

本文整理汇总了C#中org.xdrEncodeIntVector方法的典型用法代码示例。如果您正苦于以下问题:C# org.xdrEncodeIntVector方法的具体用法?C# org.xdrEncodeIntVector怎么用?C# org.xdrEncodeIntVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org的用法示例。


在下文中一共展示了org.xdrEncodeIntVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: xdrEncodeCredVerf

 /// <summary>
 /// Encodes ONC/RPC authentication information in form of a credential
 /// and a verifier when sending an ONC/RPC call message.
 /// </summary>
 /// <remarks>
 /// Encodes ONC/RPC authentication information in form of a credential
 /// and a verifier when sending an ONC/RPC call message. The
 /// <code>AUTH_UNIX</code> authentication method only uses the credential
 /// but no verifier. If the ONC/RPC server sent a <code>AUTH_SHORT</code>
 /// "shorthand" credential together with the previous reply message, it
 /// is used instead of the original credential.
 /// </remarks>
 /// <param name="xdr">
 /// XDR stream where to encode the credential and the verifier
 /// to.
 /// </param>
 /// <exception cref="OncRpcException">if an ONC/RPC error occurs.</exception>
 /// <exception cref="System.IO.IOException">if an I/O error occurs.</exception>
 /// <exception cref="org.acplt.oncrpc.OncRpcException"></exception>
 internal override void xdrEncodeCredVerf(org.acplt.oncrpc.XdrEncodingStream xdr)
 {
     if (shorthandCred == null)
     {
         //
         // Encode the credential, which contains some unsecure information
         // about user and group ID, etc. Note that the credential itself
         // is encoded as a variable-sized bunch of octets.
         //
         if ((gids.Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_GROUPS) || (machinename
             .Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_MACHINE_NAME))
         {
             throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus
                 .ONCRPC_AUTH_FAILED));
         }
         xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_UNIX);
         int len = 4 + ((machinename.Length + 7) & ~3) + 4 + 4 + gids.Length * 4 + 4;
         // length of stamp
         // len string incl. len
         // length of uid
         // length of gid
         // length of vector of gids incl. len
         if (len > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_AUTH_BYTES)
         {
             throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus
                 .ONCRPC_AUTH_FAILED));
         }
         xdr.xdrEncodeInt(len);
         xdr.xdrEncodeInt(stamp);
         xdr.xdrEncodeString(machinename);
         xdr.xdrEncodeInt(uid);
         xdr.xdrEncodeInt(gid);
         xdr.xdrEncodeIntVector(gids);
     }
     else
     {
         //
         // Use shorthand credential instead of original credential.
         //
         xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT);
         xdr.xdrEncodeDynamicOpaque(shorthandCred);
     }
     //
     // We also need to encode the verifier, which is always of
     // type AUTH_NONE.
     //
     xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE);
     xdr.xdrEncodeInt(0);
 }
开发者ID:zjianliu,项目名称:NFSClient,代码行数:68,代码来源:OncRpcClientAuthUnix.cs


注:本文中的org.xdrEncodeIntVector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。