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


C# IServerChannelSinkProvider类代码示例

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


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

示例1: Init

    void Init (IServerChannelSinkProvider provider) {
      if (!_e.Incoming)
        throw new InvalidOperationException("Non-listening Endpoint passed to IceServerChannel");

      if (!(_e is TcpEndpoint))
        throw new NotSupportedException("Only TcpEndpoints are supported as servers (for now)");

      if (provider == null) {
        provider = new IceServerFormatterSinkProvider();
      }

      IServerChannelSink nextSink = ChannelServices.CreateServerChannelSinkChain (provider, this);

      TcpEndpoint te = _e as TcpEndpoint;

      string[] uris = null;
      if (te.port != 0) {
        uris = new string[1];
        uris[0] = "ice://" + te.host + ":" + te.port;
      }

      _channelData = new ChannelDataStore (uris);
      _channelData["__iceEndpoint"] = _e;

      _sink = new IceServerTransportSink (nextSink);
      //      _listener = new TcpListener (te.IPAddress, te.port);
      _listener = new TcpListener (IPAddress.Any, te.port);
      _listenerThread = null;

      StartListening (null);
    }
开发者ID:emtees,项目名称:old-code,代码行数:31,代码来源:IceServerChannel.cs

示例2: HttpChannel

        } // HttpChannel

        public HttpChannel(IDictionary properties, 
                           IClientChannelSinkProvider clientSinkProvider,
                           IServerChannelSinkProvider serverSinkProvider)
        {
            Hashtable clientData = new Hashtable();
            Hashtable serverData = new Hashtable();
        
            // divide properties up for respective channels
            if (properties != null)
            {            
                foreach (DictionaryEntry entry in properties)
                {
                    switch ((String)entry.Key)
                    {
                    // general channel properties
                    case "name": _channelName = (String)entry.Value; break;
                    case "priority": _channelPriority = Convert.ToInt32((String)entry.Value, CultureInfo.InvariantCulture); break;
                    case "secure": _secure = Convert.ToBoolean(entry.Value, CultureInfo.InvariantCulture); 
                                    clientData["secure"] = entry.Value;
                                    serverData["secure"] = entry.Value;
                                    break;
                    default: 
                        clientData[entry.Key] = entry.Value;
                        serverData[entry.Key] = entry.Value;
                        break;
                    }
                }
            }

            _clientChannel = new HttpClientChannel(clientData, clientSinkProvider);
            _serverChannel = new HttpServerChannel(serverData, serverSinkProvider);
        } // HttpChannel
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:34,代码来源:combinedhttpchannel.cs

示例3: Receiver

		public Receiver(IDictionary properties, IServerChannelSinkProvider serverSinkProvider) 
		{	
			// administratively setup using the config values
			// static knowledge base
			ChannelName = properties.Contains(MSMQChannelProperties.ChannelName) ? 
				Convert.ToString(properties[MSMQChannelProperties.ChannelName]) : MSMQChannelDefaults.ChannelName;
			ChannelPriority = properties.Contains(MSMQChannelProperties.ChannelPriority) ? 
				Convert.ToInt32(properties[MSMQChannelProperties.ChannelPriority]) : MSMQChannelDefaults.ChannelPriority;
			ListenerPath = properties.Contains(MSMQChannelProperties.Listener) ? 
				Convert.ToString(properties[MSMQChannelProperties.Listener]) : MSMQChannelDefaults.QueuePath;
			AllowToUpdate = properties.Contains(MSMQChannelProperties.UpdateKB) ? 
				Convert.ToBoolean(properties[MSMQChannelProperties.UpdateKB]) : MSMQChannelDefaults.CanBeUpdated;
			
			// dynamically knowledge base
			NotifyTime = properties.Contains(MSMQChannelProperties.NotifyTime) ? 
				Convert.ToInt32(properties[MSMQChannelProperties.NotifyTime]) : MSMQChannelDefaults.TimeoutInSec;
			RetryTime = properties.Contains(MSMQChannelProperties.RetryTime) ?
				Convert.ToInt32(properties[MSMQChannelProperties.RetryTime]) : MSMQChannelDefaults.TimeoutInSec;
			RetryCounter = properties.Contains(MSMQChannelProperties.Retry) ? 
				Convert.ToInt32(properties[MSMQChannelProperties.Retry]) : MSMQChannelDefaults.RetryCounter;
			RetryFilter = properties.Contains(MSMQChannelProperties.RetryFilter) ? 
				Convert.ToString(properties[MSMQChannelProperties.RetryFilter]) : MSMQChannelDefaults.EmptyStr;
			NotifyUrl = properties.Contains(MSMQChannelProperties.NotifyUrl) ? 
				Convert.ToString(properties[MSMQChannelProperties.NotifyUrl]) : MSMQChannelDefaults.EmptyStr;
			AcknowledgeUrl = properties.Contains(MSMQChannelProperties.AckUrl) ? 
				Convert.ToString(properties[MSMQChannelProperties.AckUrl]) : MSMQChannelDefaults.EmptyStr;
			ExceptionUrl = properties.Contains(MSMQChannelProperties.ExceptionUrl) ? 
				Convert.ToString(properties[MSMQChannelProperties.ExceptionUrl]) : MSMQChannelDefaults.EmptyStr;
			UseTimeout = properties.Contains(MSMQChannelProperties.UseTimeout) ? 
				Convert.ToBoolean(properties[MSMQChannelProperties.UseTimeout]) : MSMQChannelDefaults.UseTimeout;
			// validate number of threads
			MaxNumberOfWorkers = MSMQChannelDefaults.MaxThreads;
			if(properties.Contains(MSMQChannelProperties.MaxThreads)) 
			{
				string maxthreads = Convert.ToString(properties[MSMQChannelProperties.MaxThreads]);
				Update(MSMQChannelProperties.MaxThreads, maxthreads);
			}
					
			// channel provider
			m_Provider = serverSinkProvider == null ? new BinaryServerFormatterSinkProvider() : serverSinkProvider;

			/*
			// Collect the rest of the channel data:
			IServerChannelSinkProvider provider = m_Provider;
			while(provider != null)
			{
				provider.GetChannelData(_data);
				provider = provider.Next;
			}
			*/
		
			IServerChannelSink next = ChannelServices.CreateServerChannelSinkChain(m_Provider, this);
			m_Sink = new MSMQServerTransportSink(next);

			// publish the MSMQChannel endpoint using the channel name.
			base.Publish(ChannelName);

			// start Listener
			StartListening(null);
		}
开发者ID:yallie,项目名称:zyan,代码行数:60,代码来源:Receiver.cs

示例4: HathiServerChannelSink

 public HathiServerChannelSink(IServerChannelSinkProvider Provider, IChannelReceiver channel)
 {
     IServerChannelSink nextServer = (IServerChannelSink)new BinaryServerFormatterSink(
                                                                         BinaryServerFormatterSink.Protocol.Other, this.NextChannelSink, channel);
     if (channel != null) m_channel = channel;
     if (Provider != null) m_Provider = Provider as HathiServerSinkProvider;
     m_NextIServerChannelSink = new HathiServerChannelSink(Provider, channel, nextServer);
 }
开发者ID:elnomade,项目名称:hathi,代码行数:8,代码来源:HathiServerChannelSink.cs

示例5: CollectChannelDataFromServerSinkProviders

 internal static void CollectChannelDataFromServerSinkProviders(ChannelDataStore channelData, IServerChannelSinkProvider provider)
 {
     while (provider != null)
     {
         provider.GetChannelData(channelData);
         provider = provider.Next;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:CoreChannel.cs

示例6: IpcChannel

 /// <summary>
 /// Creates both server and client channels.
 /// </summary>
 /// <param name="properties">The channel properties.</param>
 /// <param name="clientProvider">The client sink provider. It may be <c>null</c>.</param>
 /// <param name="serverProvider">The server sink provider. It may be <c>null</c>.</param>
 public IpcChannel(IDictionary properties,
     IClientChannelSinkProvider clientProvider,
     IServerChannelSinkProvider serverProvider
     )
 {
     clientChannel = new IpcClientChannel(properties, clientProvider);
     serverChannel = new IpcServerChannel(properties, serverProvider);
 }
开发者ID:Profit0004,项目名称:mono,代码行数:14,代码来源:IpcChannel.cs

示例7: IpcServerChannel

                public IpcServerChannel (string name, string portName,
                                         IServerChannelSinkProvider serverSinkProvider)
                {
                        _portName = portName;
                        _path = portName = BuildPathFromPortName (portName);

                        _innerChannel = Activator.CreateInstance(UnixChannelLoader.LoadServerChannel (), new object [] {name, portName, serverSinkProvider});
                }
开发者ID:Profit0004,项目名称:mono,代码行数:8,代码来源:IpcServerChannel.cs

示例8: TcpServerChannel

        } // TcpServerChannel

        /// <include file='doc\TcpServerChannel.uex' path='docs/doc[@for="TcpServerChannel.TcpServerChannel2"]/*' />
        public TcpServerChannel(String name, int port, IServerChannelSinkProvider sinkProvider)
        {
            _channelName = name;
            _port = port;
            _sinkProvider = sinkProvider;
            SetupMachineName();
            SetupChannel();
        } // TcpServerChannel
开发者ID:ArildF,项目名称:masters,代码行数:11,代码来源:tcpserverchannel.cs

示例9: Register

	static void Register (string name, string port, IServerChannelSinkProvider provider)
	{
		Hashtable props = new Hashtable ();
		props ["name"] = name;
		props ["port"] = port;
		TcpChannel c = new TcpChannel (props, null, provider);
		ChannelServices.RegisterChannel (c, false);
	}
开发者ID:mono,项目名称:gert,代码行数:8,代码来源:test.cs

示例10: PipeChannel

 public PipeChannel(
             IDictionary properties, 
             IClientChannelSinkProvider clientProviderChain,
             IServerChannelSinkProvider serverProviderChain
         )
 {
     _clientChannel = new PipeClientChannel(properties, clientProviderChain);
       _serverChannel = new PipeServerChannel(properties, serverProviderChain);
 }
开发者ID:hostitherepc,项目名称:Fork-1,代码行数:9,代码来源:PipeChannel.cs

示例11: IpcChannel

 public IpcChannel (IDictionary properties,
                    IClientChannelSinkProvider clientSinkProvider,
                    IServerChannelSinkProvider serverSinkProvider)
 {
         if (IsUnix)
                 _innerChannel = new Unix.IpcChannel (properties, clientSinkProvider, serverSinkProvider);
         else
                 _innerChannel = new Win32.IpcChannel (properties, clientSinkProvider, serverSinkProvider);
 }
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:9,代码来源:IpcChannel.cs

示例12: IpcServerChannel

        } // IpcServerChannel

        public IpcServerChannel(String name, string portName, IServerChannelSinkProvider sinkProvider) 
        {
            if (portName == null) 
                throw new RemotingException(CoreChannel.GetResourceString( 
                                            "Remoting_Ipc_NoPortNameSpecified"));
            _channelName = name; 
            _portName = portName;
            _sinkProvider = sinkProvider;
            SetupChannel();
        } // IpcServerChannel 
开发者ID:wsky,项目名称:System.Runtime.Remoting,代码行数:12,代码来源:IpcServerChannel.cs

示例13: IpcServerChannel

        public IpcServerChannel(IDictionary properties, IServerChannelSinkProvider sinkProvider, CommonSecurityDescriptor securityDescriptor)
        {
            this._channelPriority = 20;
            this._channelName = "ipc server";
            this._bExclusiveAddressUse = true;
            this._waitForStartListening = new AutoResetEvent(false);
            if (properties != null)
            {
                foreach (DictionaryEntry entry in properties)
                {
                    switch (((string) entry.Key))
                    {
                        case "name":
                            this._channelName = (string) entry.Value;
                            break;

                        case "portName":
                            this._portName = (string) entry.Value;
                            break;

                        case "priority":
                            this._channelPriority = Convert.ToInt32(entry.Value, CultureInfo.InvariantCulture);
                            break;

                        case "secure":
                            this._secure = Convert.ToBoolean(entry.Value, CultureInfo.InvariantCulture);
                            break;

                        case "impersonate":
                            this._impersonate = Convert.ToBoolean(entry.Value, CultureInfo.InvariantCulture);
                            this.authSet = true;
                            break;

                        case "suppressChannelData":
                            this._bSuppressChannelData = Convert.ToBoolean(entry.Value, CultureInfo.InvariantCulture);
                            break;

                        case "authorizedGroup":
                            this._authorizedGroup = (string) entry.Value;
                            break;

                        case "exclusiveAddressUse":
                            this._bExclusiveAddressUse = Convert.ToBoolean(entry.Value, CultureInfo.InvariantCulture);
                            break;
                    }
                }
            }
            if (this._portName == null)
            {
                throw new RemotingException(CoreChannel.GetResourceString("Remoting_Ipc_NoPortNameSpecified"));
            }
            this._sinkProvider = sinkProvider;
            this._securityDescriptor = securityDescriptor;
            this.SetupChannel();
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:55,代码来源:IpcServerChannel.cs

示例14: ServerChannelCreateSinkProviderChain

		public static IServerChannelSinkProvider ServerChannelCreateSinkProviderChain(
			IServerChannelSinkProvider formatterSinkProvider)
		{
			if (formatterSinkProvider == null)
			{
				// we use MSFT BinaryFormatter by default for maximum compatibility
				formatterSinkProvider = new BinaryServerFormatterSinkProvider();
			}

			return formatterSinkProvider;
		}
开发者ID:Orvid,项目名称:NAntUniversalTasks,代码行数:11,代码来源:ChannelHelper.cs

示例15: HttpChannel

		public HttpChannel (IDictionary properties,
			IClientChannelSinkProvider clientSinkProvider,
			IServerChannelSinkProvider serverSinkProvider)
		{
			if (properties != null && properties.Contains ("name")) {
				this.name = (string)properties["name"];
			}

			client = new HttpClientChannel (properties, clientSinkProvider);
			server = new HttpServerChannel (properties, serverSinkProvider);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:HttpChannel.cs


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