• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IServerChannelSinkStack类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IServerChannelSinkStack的典型用法代码示例。如果您正苦于以下问题:C# IServerChannelSinkStack类的具体用法?C# IServerChannelSinkStack怎么用?C# IServerChannelSinkStack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IServerChannelSinkStack类属于命名空间,在下文中一共展示了IServerChannelSinkStack类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ProcessMessage

		/// <summary></summary>
		public ServerProcessing ProcessMessage(
			IServerChannelSinkStack sinkStack,
			IMessage requestMsg,
			ITransportHeaders requestHeaders,
			Stream requestStream,
			out IMessage responseMsg,
			out ITransportHeaders responseHeaders,
			out Stream responseStream)
		{
			if (NextChannelSink != null)
			{
				SetClientIpAddressDataHelper(requestHeaders);
				ServerProcessing spres = NextChannelSink.ProcessMessage(
					sinkStack,
					requestMsg,
					requestHeaders,
					requestStream,
					out responseMsg,
					out responseHeaders,
					out responseStream);
				return spres;
			}

			responseMsg = null;
			responseHeaders = null;
			responseStream = null;
			return new ServerProcessing();
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:29,代码来源:ClientIPServerSink.cs


示例2: ProcessMessage

 public ServerProcessing ProcessMessage(
         IServerChannelSinkStack sinkStack,
         IMessage requestMsg,
         ITransportHeaders requestHeaders,
         Stream requestStream,
         out IMessage responseMsg,
         out ITransportHeaders responseHeaders,
         out Stream responseStream)
 {
     if (_nextSink != null)
         {
             IPAddress ip =
                 requestHeaders[CommonTransportKeys.IPAddress] as IPAddress;
             CallContext.SetData("ClientIPAddress", ip);
             ServerProcessing spres = _nextSink.ProcessMessage(
                 sinkStack,
                 requestMsg,
                 requestHeaders,
                 requestStream,
                 out responseMsg,
                 out responseHeaders,
                 out responseStream);
             return spres;
         }
         else
         {
             responseMsg = null;
             responseHeaders = null;
             responseStream = null;
             return new ServerProcessing();
         }
 }
开发者ID:jsvgoncalves,项目名称:tdin-chat-server,代码行数:32,代码来源:ClientIPServerSinkProvider.cs


示例3: ProcessMessage

		public ServerProcessing ProcessMessage (IServerChannelSinkStack sinkStack,
							IMessage requestMsg,
							ITransportHeaders requestHeaders,
							Stream requestStream,
							out IMessage responseMsg,
							out ITransportHeaders responseHeaders,
							out Stream responseStream)
		{
			IMessage call;
			
			string uri = (string)requestHeaders [CommonTransportKeys.RequestUri];

			if (requestMsg == null) {
				call = (IMessage)format.DeserializeRequest (requestStream, uri);
			} else { 
				call = requestMsg;
			}

			next_sink.ProcessMessage (sinkStack, call, requestHeaders, null,
						  out responseMsg, out responseHeaders, out responseStream);
						
			responseStream = new MemoryStream ();

			format.SerializeResponse (responseStream, responseMsg);
			
			return ServerProcessing.Complete;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:27,代码来源:SimpleServerFormatterSink.cs


示例4: ProcessMessage

		public ServerProcessing ProcessMessage(
			IServerChannelSinkStack sinkStack_in,
			IMessage requestMsg_in,
			ITransportHeaders requestHeaders_in,
			Stream requestStream_in,

			out IMessage responseMsg_out,
			out ITransportHeaders responseHeaders_out,
			out Stream responseStream_out
		) {
			if (nextchannelsink_ != null) {
				CallContext.SetData(
					"ClientIPAddress", 
					((IPAddress)requestHeaders_in[CommonTransportKeys.IPAddress]).ToString()
				);
				ServerProcessing _serverprocessing = NextChannelSink.ProcessMessage(
					sinkStack_in,
					requestMsg_in,
					requestHeaders_in,
					requestStream_in,

					out responseMsg_out,
					out responseHeaders_out,
					out responseStream_out
				);
				return _serverprocessing;
			} else {
				responseMsg_out = null;
				responseHeaders_out = null;
				responseStream_out = null;
				return new ServerProcessing();
			}
		}
开发者ID:BackupTheBerlios,项目名称:ogen-svn,代码行数:33,代码来源:ClientIPAddressServerSink.cs


示例5: ProcessMessage

        [System.Security.SecurityCritical]  // auto-generated
        public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack,
            IMessage requestMsg,
            ITransportHeaders requestHeaders, Stream requestStream,
            out IMessage responseMsg, out ITransportHeaders responseHeaders,
            out Stream responseStream)
        {
            if (requestMsg == null)
            {
                throw new ArgumentNullException(
                    "requestMsg", 
                    Environment.GetResourceString("Remoting_Channel_DispatchSinkMessageMissing"));
            }
            Contract.EndContractBlock();

            // check arguments
            if (requestStream != null)
            {
                throw new RemotingException(
                    Environment.GetResourceString("Remoting_Channel_DispatchSinkWantsNullRequestStream"));
            }

            responseHeaders = null;
            responseStream = null;
            return ChannelServices.DispatchMessage(sinkStack, requestMsg, out responseMsg);                
        } // ProcessMessage
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:26,代码来源:dispatchchannelsink.cs


示例6: ProcessMessage

		public ServerProcessing ProcessMessage(
			IServerChannelSinkStack sinkStack, 
			IMessage requestMsg, 
			ITransportHeaders requestHeaders, 
			Stream requestStream, 
			out IMessage responseMsg, 
			out ITransportHeaders responseHeaders, 
			out Stream responseStream)
		{
			var ip = requestHeaders[CommonTransportKeys.IPAddress] as IPAddress;
			CallContext.SetData("ClientIPAddress", ip);

			var connectionId = (Int64)requestHeaders[CommonTransportKeys.ConnectionId];
			CallContext.SetData("ClientConnectionId", connectionId); 
			
			if (_next != null) 
			{
				var spres =  _next.ProcessMessage (sinkStack,requestMsg, requestHeaders,requestStream,out responseMsg,out responseHeaders,out responseStream);
				return spres;
			} 
			else 
			{
				responseMsg=null;
				responseHeaders=null;
				responseStream=null;
				return new ServerProcessing();
			}
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:28,代码来源:CustomSoapServerFormatterSinkProvider.cs


示例7: ProcessMessage

    public ServerProcessing ProcessMessage (IServerChannelSinkStack sinkStack,
                                            IMessage requestMsg,
                                            ITransportHeaders requestHeaders,
                                            Stream requestStream,
                                            out IMessage responseMsg,
                                            out ITransportHeaders responseHeaders,
                                            out Stream responseStream)
    {
      IMessage call;
      MessageType mtype = (Ice.MessageType) requestHeaders["__iceMessageType"];
      bool isBatched = (mtype == Ice.MessageType.BatchRequest);

      try {
        if (requestMsg == null) {
          requestMsg = IceChannelUtils.ProtocolRequestToMessage (requestStream, isBatched);
        } else {
          call = requestMsg;
        }

        Trace.WriteLine ("IceServerFormatterSink: passing upstream");
        _next.ProcessMessage (sinkStack, requestMsg, requestHeaders, null,
                              out responseMsg, out responseHeaders, out responseStream);
        Trace.WriteLine ("IceServerFormatterSink: returned");

        responseStream = new MemoryStream();
        IceChannelUtils.MessageToProtocolReply (requestMsg, responseMsg, responseStream);
      } catch (Exception e) {
        Console.WriteLine (e.ToString());
        throw e;
      }
      return ServerProcessing.Complete;
    }
开发者ID:emtees,项目名称:old-code,代码行数:32,代码来源:IceServerFormatterSink.cs


示例8: ProcessMessage

		public ServerProcessing ProcessMessage (IServerChannelSinkStack sinkStack, IMessage requestMsg,
			ITransportHeaders requestHeaders, Stream requestStream, out IMessage responseMsg,
			out ITransportHeaders responseHeaders, out Stream responseStream)
		{
			//we know we never call this
			throw new NotSupportedException ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:HttpServerTransportSink.cs


示例9: ProcessMessage

 public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMessage, ITransportHeaders requestHeaders, Stream requestStream, out IMessage responseMessage, out ITransportHeaders responseHeaders, out Stream responseStream)
 {
     requestStream = Zip.Decompress(requestStream);
     sinkStack.Push(this, null);
     ServerProcessing processing = this.m_NextSink.ProcessMessage(sinkStack, requestMessage, requestHeaders, requestStream, out responseMessage, out responseHeaders, out responseStream);
     responseStream = Zip.Compress(responseStream);
     return processing;
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:8,代码来源:ZipServerSink.cs


示例10: DispatchMessage

    public static ServerProcessing DispatchMessage(IServerChannelSinkStack sinkStack, System.Runtime.Remoting.Messaging.IMessage msg, out System.Runtime.Remoting.Messaging.IMessage replyMsg)
    {
      Contract.Ensures(((System.Runtime.Remoting.Channels.ServerProcessing)(0)) <= Contract.Result<System.Runtime.Remoting.Channels.ServerProcessing>());
      Contract.Ensures(Contract.Result<System.Runtime.Remoting.Channels.ServerProcessing>() <= ((System.Runtime.Remoting.Channels.ServerProcessing)(1)));

      replyMsg = default(System.Runtime.Remoting.Messaging.IMessage);

      return default(ServerProcessing);
    }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:9,代码来源:System.Runtime.Remoting.Channels.ChannelServices.cs


示例11: ProcessMessage

 public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, out IMessage responseMsg, out ITransportHeaders responseHeaders, out Stream responseStream)
 {
     if(requestMsg is IMethodCallMessage)
     {
         IMethodCallMessage call = (IMethodCallMessage)requestMsg;
         if(!provider.Filter(call.MethodBase))
             throw new MemberAccessException("You are not allowed to access this member via remoting!");
     }
     return next.ProcessMessage(sinkStack, requestMsg, requestHeaders, requestStream, out responseMsg, out responseHeaders, out responseStream);
 }
开发者ID:sciaopin,项目名称:bang-sharp,代码行数:10,代码来源:MethodRestrictionServerSink.cs


示例12: ProcessMessage

		public ServerProcessing ProcessMessage (IServerChannelSinkStack sinkStack,
							IMessage requestMsg,
							ITransportHeaders requestHeaders,
							Stream requestStream,
							out IMessage responseMsg,
							out ITransportHeaders responseHeaders,
							out Stream responseStream)
		{
			// this is the first sink, and SimpleServerChannel does not call it.
			throw new NotSupportedException ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:11,代码来源:SimpleServerTransportSink.cs


示例13: ProcessMessage

 public ServerProcessing ProcessMessage (IServerChannelSinkStack sinkStack,
                                         IMessage requestMsg,
                                         ITransportHeaders requestHeaders,
                                         Stream requestStream,
                                         out IMessage responseMsg,
                                         out ITransportHeaders responseHeaders,
                                         out Stream responseStream)
 {
   // this sink is always first, and this method isn't usued as the entry point
   throw new NotSupportedException();
 }
开发者ID:emtees,项目名称:old-code,代码行数:11,代码来源:IceServerTransportSink.cs


示例14: ArgumentNullException

	public static ServerProcessing DispatchMessage
				(IServerChannelSinkStack sinkStack, IMessage msg,
		    	 out IMessage replyMsg)
			{
				if(msg == null)
				{
					throw new ArgumentNullException("msg");
				}
				// TODO
				replyMsg = null;
				return ServerProcessing.Complete;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:12,代码来源:ChannelServices.cs


示例15: ProcessMessage

 public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, out IMessage responseMsg, out ITransportHeaders responseHeaders, out Stream responseStream)
 {
     if (this._nextSink != null)
     {
         object obj1 = requestHeaders["__IPAddress"];
         return this._nextSink.ProcessMessage(sinkStack, requestMsg, requestHeaders, requestStream, out responseMsg, out responseHeaders, out responseStream);
     }
     responseMsg = null;
     responseHeaders = null;
     responseStream = null;
     return ServerProcessing.Complete;
 }
开发者ID:lexzh,项目名称:Myproject,代码行数:12,代码来源:ClientIPServerSink.cs


示例16: ProcessMessage

		public ServerProcessing ProcessMessage (IServerChannelSinkStack sinkStack,
							IMessage requestMsg,
							ITransportHeaders requestHeaders,
							Stream requestStream,
							out IMessage responseMsg,
							out ITransportHeaders responseHeaders,
							out Stream responseStream)
		{
			responseHeaders = null;			
			responseStream = null;

			return ChannelServices.DispatchMessage(sinkStack, requestMsg, out responseMsg);
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:13,代码来源:ServerDispatchSink.cs


示例17: BinaryFormatter

            ServerProcessing IServerChannelSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, out IMessage responseMsg, out ITransportHeaders responseHeaders, out Stream responseStream)
            {
                BinaryFormatter binaryFormatter = new BinaryFormatter();
                binaryFormatter.Binder = new GenericsVTSSerializationBinder();
                requestMsg = (IMessage)binaryFormatter.Deserialize(requestStream);
                requestMsg.Properties["__Uri"] = requestHeaders["__RequestUri"];

                next.ProcessMessage(sinkStack, requestMsg, null, null, out responseMsg, out responseHeaders, out responseStream);

                responseHeaders = new TransportHeaders();
                responseStream = new MemoryStream();
                binaryFormatter.Serialize(responseStream, responseMsg);
                responseStream.Position = 0;

                return ServerProcessing.Complete;
            }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:16,代码来源:GenericsVTSSBSinkProvider.cs


示例18: ProcessMessage

 public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, out IMessage responseMsg, out ITransportHeaders responseHeaders, out Stream responseStream)
 {
     IPAddress address = requestHeaders["__IPAddress"] as IPAddress;
       Console.Write("Process message from {0} ... ", address);
       if (!this.MatchIPAddress(address) ^ this.m_IsAccept)
       {
     TraceInfoEvent.Raise(string.Format("{0} is accepted by IPFilterChannelSink.", address));
     Console.WriteLine("accepted");
     return this.m_NextSink.ProcessMessage(sinkStack, requestMsg, requestHeaders, requestStream, out responseMsg, out responseHeaders, out responseStream);
       }
       TraceInfoEvent.Raise(string.Format("{0} is rejected by IPFilterChannelSink.", address));
       responseHeaders = new TransportHeaders();
       responseMsg = null;
       responseStream = null;
       return ServerProcessing.Complete;
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:16,代码来源:IPFilterChannelSink.cs


示例19: ProcessMessage

 public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMessage, ITransportHeaders requestHeaders, Stream requestStream, out IMessage responseMessage, out ITransportHeaders responseHeaders, out Stream responseStream)
 {
     if (this.m_NextSink != null)
     {
         LogicalCallContext context = (LogicalCallContext) requestMessage.Properties["__CallContext"];
         if ((context != null) && (context.GetData("PrincipalContextData") != null))
         {
             PrincipalContextData data = (PrincipalContextData) context.GetData("PrincipalContextData");
             Thread.CurrentPrincipal = data.Principal;
         }
         return this.m_NextSink.ProcessMessage(sinkStack, requestMessage, requestHeaders, requestStream, out responseMessage, out responseHeaders, out responseStream);
     }
     responseMessage = null;
     responseHeaders = null;
     responseStream = null;
     return ServerProcessing.Complete;
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:17,代码来源:PrincipalServerSink.cs


示例20: ProcessMessage

 public ServerProcessing ProcessMessage(
     IServerChannelSinkStack sinkStack,
     IMessage requestMsg,
     ITransportHeaders requestHeaders,
     Stream requestStream,
     out IMessage responseMsg,
     out ITransportHeaders responseHeaders,
     out Stream responseStream)
 {
     try
     {
         if (_next != null)
         {
             ip = (IPAddress)requestHeaders[CommonTransportKeys.IPAddress];
             if (ip != null && (ip.ToString().Trim() == "127.0.0.1" || CheckAuthorizedIP(ip.ToString())))
             {
                 Common.CurrentStatus(ip.ToString().Trim());
                 ServerProcessing spres = _next.ProcessMessage(sinkStack, requestMsg, requestHeaders, requestStream, out responseMsg, out responseHeaders, out responseStream);
                 return spres;
             }
             else
             {
                 Common.Log("Unauthorized Remoting IP: " + ip.ToString().Trim());
                 responseMsg = null;
                 responseHeaders = null;
                 responseStream = null;
                 return new ServerProcessing();
             }
         }
         else
         {
             responseMsg = null;
             responseHeaders = null;
             responseStream = null;
             return new ServerProcessing();
         }
     }
     catch (Exception err)
     {
         Common.Log(err);
         responseMsg = null;
         responseHeaders = null;
         responseStream = null;
         return new ServerProcessing();
     }
 }
开发者ID:thetazhou,项目名称:StockTrading,代码行数:46,代码来源:RemotingProvider.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IServerConfig类代码示例发布时间:2022-05-24
下一篇:
C# IServerChannelSinkProvider类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap