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


C# org.xdrDecodeString方法代码示例

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


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

示例1: xdrDecodeCredVerf

		/// <summary>
		/// Decodes -- that is: deserializes -- an ONC/RPC authentication object
		/// (credential & verifier) on the server side.
		/// </summary>
		/// <remarks>
		/// Decodes -- that is: deserializes -- an ONC/RPC authentication object
		/// (credential & verifier) on the server side.
		/// </remarks>
		/// <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 sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream 
			xdr)
		{
			//
			// Reset some part of the object's state...
			//
			shorthandVerf = null;
			//
			// Now pull off the object state of the XDR stream...
			//
			int realLen = xdr.xdrDecodeInt();
			stamp = xdr.xdrDecodeInt();
			machinename = xdr.xdrDecodeString();
			uid = xdr.xdrDecodeInt();
			gid = xdr.xdrDecodeInt();
			gids = xdr.xdrDecodeIntVector();
			//
			// Make sure that the indicated length of the opaque data is kosher.
			// If not, throw an exception, as there is something strange going on!
			//
			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 (realLen != len)
			{
				if (realLen < len)
				{
					throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW
						));
				}
				else
				{
					throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_AUTHERROR
						));
				}
			}
			//
			// We also need to decode the verifier. This must be of type
			// AUTH_NONE too. For some obscure historical reasons, we have to
			// deal with credentials and verifiers, although they belong together,
			// according to Sun's specification.
			//
			if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || (
				xdr.xdrDecodeInt() != 0))
			{
				throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus
					.ONCRPC_AUTH_BADVERF));
			}
		}
开发者ID:mushuanli,项目名称:nekodrive,代码行数:62,代码来源:OncRpcServerAuthUnix.cs

示例2: xdrDecode

		/// <summary>
		/// Decodes -- that is: deserializes -- a XDR string from a XDR stream in
		/// compliance to RFC 1832.
		/// </summary>
		/// <remarks>
		/// Decodes -- that is: deserializes -- a XDR string from a XDR stream in
		/// compliance to RFC 1832.
		/// </remarks>
		/// <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>
		public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr)
		{
			value = xdr.xdrDecodeString();
		}
开发者ID:mushuanli,项目名称:nekodrive,代码行数:15,代码来源:XdrString.cs


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