示例#1
0
 internal void Add(IChannelSender sender)
 {
     if (!this._senders.Contains(sender))
         lock (this._senders)
             if (!this._senders.Contains(sender))
                 this._senders.Add(sender);
 }
示例#2
0
 private IClientChannel GetChannel(IChannelSender sender)
 {
     var channel = sender as IClientChannel;
     if (channel.OnMessage == null)
         channel.OnMessage = this._onMessage;
     return channel;
 }
 public IClientChannelSink CreateSink(IChannelSender channel, string url, object remoteChannelData)
 {
     IClientChannelSink nextSink = null;
     if (nextProvider != null)
         nextSink = nextProvider.CreateSink(channel, url, remoteChannelData);
     return new ClientChannelImpersonationSink(nextSink, username, password);
 }
 internal DelayLoadClientChannelEntry(RemotingXmlConfigFileData.ChannelEntry entry, bool ensureSecurity)
 {
     this._entry = entry;
     this._channel = null;
     this._bRegistered = false;
     this._ensureSecurity = ensureSecurity;
 }
示例#5
0
 public IpcClientChannel ()
 {
         if (IpcChannel.IsUnix)
                 _innerChannel = new Unix.IpcClientChannel ();
         else
                 _innerChannel = new Win32.IpcClientChannel ();
 }
示例#6
0
 public ClientSinkData(SinkProviderData configurationData, IChannelSender channel, string url, object remoteChannelData)
 {
     this.Channel = channel;
     this.Url = url;
     this.RemoteChannelData = remoteChannelData;
     this.ConfigurationData = configurationData;
 }
示例#7
0
 public IpcClientChannel (IDictionary properties,
                          IClientChannelSinkProvider sinkProvider)
 {
         if (IpcChannel.IsUnix)
                 _innerChannel = new Unix.IpcClientChannel (properties, sinkProvider);
         else
                 _innerChannel = new Win32.IpcClientChannel (properties, sinkProvider);
 }
示例#8
0
 public IpcClientChannel (string name,
                          IClientChannelSinkProvider sinkProvider)
 {
         if (IpcChannel.IsUnix)
                 _innerChannel = new Unix.IpcClientChannel (name, sinkProvider);
         else
                 _innerChannel = new Win32.IpcClientChannel (name, sinkProvider);
 }
示例#9
0
        void Transmit(IChannelSender channelSender, Site targetSite, CallType callType, IDictionary<string,string> headers, Stream data)
        {
            headers[HeaderMapper.NServiceBus + HeaderMapper.CallType] = Enum.GetName(typeof(CallType), callType);
            headers[HttpHeaders.ContentMd5Key] = Hasher.Hash(data);

            Logger.DebugFormat("Sending message - {0} to: {1}", callType, targetSite.Address);

            channelSender.Send(targetSite.Address, headers, data);
        }
示例#10
0
        private Sender m_Sender; // channel

        #endregion Fields

        #region Constructors

        public MSMQClientTransportSink(IChannelSender channel, string url)
        {
            // state
            m_Sender = channel as Sender;		// parent
            m_LogicalUri = url;					// url address trimed by channel name

            // echo
            Trace.WriteLine(string.Format("[{0}]MSMQClientTransportSink has been contructed", m_Sender.ChannelName));
        }
		public IClientChannelSink CreateSink( IChannelSender channel, 
		                                             string url, 
		                                             object remoteChannelData)
		{
			IClientChannelSink _nextSink = _nextClientChannelSinkProvider.CreateSink(channel, url, remoteChannelData);
			
			SoapClientFormatterSink scfs = new SoapClientFormatterSink(_nextSink); 
			scfs.SoapCore = _soapCore;
			return scfs;
		}
 public IClientChannelSink CreateSink(IChannelSender channel, string url, object remoteChannelData)
 {
     if (this.Next != null)
     {
         var nextChannelSink = Next.CreateSink(channel, url, remoteChannelData);
         if (nextChannelSink != null)
             return new JsonClientFormatterSink(nextChannelSink);
     }
     return null;
 }
        public IClientChannelSink CreateSink(IChannelSender channel, string url, object remoteChannelData)
        {
            IClientChannelSink nextSink = null;

            if (_nextProvider != null)
                // создаем следующий приемник в цепи
                nextSink = _nextProvider.CreateSink(channel, url, remoteChannelData);

            // добавляем наш приемник в цепь
            return new IpFixClientChannelSink(nextSink, _serverHostNameOrIp);
        }
		/// <summary>
		/// Creates a sink chain.
		/// </summary>
		public IClientChannelSink CreateSink (IChannelSender channel, string url, object remoteChannelData) {
			// Create next sink:
			IClientChannelSink nextSink = next.CreateSink(channel,url,remoteChannelData);
			// Return current sink chained to next sink:
			IMessageSink nextMessageSink = nextSink as IMessageSink;
			if (nextMessageSink != null) {
				return new RemotingMockingSink(nextMessageSink);
			} else {
				throw new RemotingException(String.Format("Remoting configuration error : the '{0}' provider should be defined as provider in the clientProviders section of the channel, before any formatter.", this.GetType()));
			}
		}
示例#15
0
		protected virtual int CreateServer ()
		{
			ChannelManager cm = CreateChannelManager ();
			chs = cm.CreateClientChannel ();
			ChannelServices.RegisterChannel (chs);

			AppDomain domain = AppDomain.CreateDomain ("testdomain");
			server = (CallsDomainServer) domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName,"MonoTests.Remoting.CallsDomainServer");
			remoteUris = server.Start (cm);
			return server.GetDomId ();
		}
        void Transmit(IChannelSender channelSender, Site targetSite, CallType callType,
            IDictionary<string, string> headers, Stream data)
        {
            headers[GatewayHeaders.IsGatewayMessage] = Boolean.TrueString;
            headers["NServiceBus.CallType"] = Enum.GetName(typeof(CallType), callType);
            headers[HttpHeaders.ContentMD5] = Hasher.Hash(data);

            Logger.DebugFormat("Sending message - {0} to: {1}", callType, targetSite.Channel.Address);

            channelSender.Send(targetSite.Channel.Address, headers, data);
        }
 public IClientChannelSink CreateSink(IChannelSender channel, string url, object remoteChannelData)
 {
     TcpClientTransportSink sink = new TcpClientTransportSink(url, (TcpClientChannel) channel);
     if (this._prop != null)
     {
         foreach (object obj2 in this._prop.Keys)
         {
             sink[obj2] = this._prop[obj2];
         }
     }
     return sink;
 }
示例#18
0
        public IClientChannelSink CreateSink(IChannelSender channel, String url, Object remoteChannelData)
        {
            IClientChannelSink nextSink = null;
            if (_next != null)
            {
                nextSink = _next.CreateSink(channel, url, remoteChannelData);
                if (nextSink == null)
                    return null;
            }

            return new ClientChannelSink(url, nextSink);
        }
示例#19
0
 internal IDictionary<string, object> SendAndWait(EndpointProxy e
     , IChannelSender sender
     , Message message
     , int timeout)
 {
     SendCallback callback = new SendCallback(e);
     this.Send(message, sender, callback);
     callback.WaitReturn(timeout);
     if (callback.Error != null)
         throw callback.Error;
     return callback.Return;
 }
示例#20
0
        public IClientChannelSink CreateSink(IChannelSender channel, string url, object remoteChannelData)
        {
            // create the Message Sink
            IClientChannelSink sink = new MSMQClientTransportSink(channel, url);

            // echo
            Trace.WriteLine(string.Format("[{0}]MSMQClientProvider.CreateSink has been initiated. url={1}",
                channel.ChannelName, url));

            // successful result
            return sink;
        }
示例#21
0
 public void Send(Message message, IChannelSender sender, SendCallback callback)
 {
     if (callback != null)
     {
         message.Flag = System.Threading.Interlocked.Increment(ref this._flag);
         this._callbacks.Add(message.Flag, callback);
     }
     using (var s = new MemoryStream())
     {
         MessageIO.WriteMessage(s, message);
         this.GetChannel(sender).Send(s.ToArray());
     }
 }
		public IClientChannelSink CreateSink(
			IChannelSender channel_in,
			string url_in,
			object remoteChannelData_in
		) {
			IClientChannelSink _next = next_.CreateSink(
				channel_in,
				url_in,
				remoteChannelData_in
			);

			return new CompressionClientSink(_next);
		} 
        public IClientChannelSink CreateSink(IChannelSender channel, string url, object remoteChannelData)
        {
            IClientChannelSink nextSink = null;

            if (_next != null) {
                // Call CreateSink on the next sink provier in the chain.  This will return
                // to us the actual next sink object.  If the next sink is null, uh oh!
                if ((nextSink = _next.CreateSink(channel, url, remoteChannelData)) == null) return null;
            }

            // Create this sink, passing to it the previous sink in the chain so that it knows
            // to whom messages should be passed.
            return new CompressedClientChannelSink(nextSink);
        }
 // public methods
 /// <summary>
 /// 
 /// </summary>
 /// <param name="channel"></param>
 /// <param name="url"></param>
 /// <param name="remoteChannelData"></param>
 /// <returns></returns>
 public IClientChannelSink CreateSink(
   IChannelSender channel,
   string url,
   object remoteChannelData)
 {
     IClientChannelSink ccs = null;
     if (m_next != null)
     {
         ccs = m_next.CreateSink(channel, url, remoteChannelData);
         if (ccs == null)
             return null;
     }
     return new XmlRpcClientFormatterSink(ccs);
 }
 public IClientChannelSink CreateSink(IChannelSender channel, string url, object remoteChannelData)
 {
     IClientChannelSink nextSink = null;
     if (this._next != null)
     {
         nextSink = this._next.CreateSink(channel, url, remoteChannelData);
         if (nextSink == null)
         {
             return null;
         }
     }
     SinkChannelProtocol protocol = CoreChannel.DetermineChannelProtocol(channel);
     return new SoapClientFormatterSink(nextSink) { IncludeVersioning = this._includeVersioning, StrictBinding = this._strictBinding, ChannelProtocol = protocol };
 }
    public IClientChannelSink CreateSink (IChannelSender channel,
                                          string url,
                                          object remoteChannelData)
    {
      IClientChannelSink nextsink = null;
      IceClientFormatterSink result;

      if (_next != null)
        nextsink = _next.CreateSink (channel, url, remoteChannelData);

      result = new IceClientFormatterSink (nextsink);

      return result;
    }
		public IClientChannelSink CreateSink (IChannelSender channel,
						      string url,
						      object remoteChannelData)
		{
			IClientChannelSink next_sink = null;
			BinaryClientFormatterSink result;
			
			if (next != null)
				next_sink = next.CreateSink (channel, url, remoteChannelData);
			
			result = new BinaryClientFormatterSink (next_sink);
			result.BinaryCore = _binaryCore;

			return result;
		}		
        public IClientChannelSink CreateSink(IChannelSender channel, string url, object remoteChannelData)
        {
            IClientChannelSink nextSink = null;
            if (_nextProvider != null)
            {
                nextSink = _nextProvider.CreateSink(channel, url, remoteChannelData);
            }

            if (nextSink != null)
            {
                return new ClientFormatterSink(Formatter, nextSink);
            }

            return null;
        }
        public IClientChannelSink CreateSink(IChannelSender channel, string url, object data)
        {
            // parameters validation
            var pipeChannel = channel as PipeClientChannel;
            if (pipeChannel == null)
                throw new NotSupportedException();

            // parse object url
            string objectUri;
            string channelUri = pipeChannel.Parse(url, out objectUri);
            if (channelUri == null)
                throw new NotSupportedException();

            // create transport sink
            return new ClientTransportSink(channelUri, pipeChannel.ConnectionCache);
        }
		public IClientChannelSink CreateSink (IChannelSender channel,
						      string url,
						      object remoteChannelData)
		{
			IClientChannelSink next_sink = null;
			CORBAClientFormatterSink result;
			
			if (next != null)
				next_sink = next.CreateSink (channel, url, remoteChannelData);
			
			result = new CORBAClientFormatterSink (next_sink);

			// set properties on the newly creates sink

			return result;
		}