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


C# org.xdrDecodeCredVerf方法代码示例

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


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

示例1: xdrNew

        /// <summary>Restores (deserializes) an authentication object from an XDR stream.</summary>
        /// <remarks>Restores (deserializes) an authentication object from an XDR stream.</remarks>
        /// <param name="xdr">
        /// XDR stream from which the authentication object is
        /// restored.
        /// </param>
        /// <param name="recycle">
        /// old authtentication object which is intended to be
        /// reused in case it is of the same authentication type as the new
        /// one just arriving from the XDR stream.
        /// </param>
        /// <returns>
        /// Authentication information encapsulated in an object, whose class
        /// is derived from <code>OncRpcServerAuth</code>.
        /// </returns>
        /// <exception cref="org.acplt.oncrpc.OncRpcException">if an ONC/RPC error occurs.</exception>
        /// <exception cref="System.IO.IOException">if an I/O error occurs.</exception>
        public static org.acplt.oncrpc.server.OncRpcServerAuth xdrNew(org.acplt.oncrpc.XdrDecodingStream
			 xdr, org.acplt.oncrpc.server.OncRpcServerAuth recycle)
        {
            org.acplt.oncrpc.server.OncRpcServerAuth auth;
            //
            // In case we got an old authentication object and we are just about
            // to receive an authentication with the same type, we reuse the old
            // object.
            //
            int authType = xdr.xdrDecodeInt();
            if ((recycle != null) && (recycle.getAuthenticationType() == authType))
            {
                //
                // Simply recycle authentication object and pull its new state
                // of the XDR stream.
                //
                auth = recycle;
                auth.xdrDecodeCredVerf(xdr);
            }
            else
            {
                switch (authType)
                {
                    case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE:
                    {
                        //
                        // Create a new authentication object and pull its state off
                        // the XDR stream.
                        //
                        auth = org.acplt.oncrpc.server.OncRpcServerAuthNone.AUTH_NONE;
                        auth.xdrDecodeCredVerf(xdr);
                        break;
                    }

                    case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT:
                    {
                        auth = new org.acplt.oncrpc.server.OncRpcServerAuthShort(xdr);
                        break;
                    }

                    case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_UNIX:
                    {
                        auth = new org.acplt.oncrpc.server.OncRpcServerAuthUnix(xdr);
                        break;
                    }

                    default:
                    {
                        //
                        // In case of an unknown or unsupported type, throw an exception.
                        // Note: using AUTH_REJECTEDCRED is in sync with the way Sun's
                        // ONC/RPC implementation does it. But don't ask me why they do
                        // it this way...!
                        //
                        throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus
                            .ONCRPC_AUTH_REJECTEDCRED));
                    }
                }
            }
            return auth;
        }
开发者ID:zjianliu,项目名称:NFSClient,代码行数:78,代码来源:OncRpcServerAuth.cs


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