public NamedPipeChannel(NamedPipeChannelDefinition definition, PipeProxy pipe, IDispatcher dispatcher)
 {
     Definition = definition;
     Name       = definition.Name;
     Dispatcher = dispatcher;
     Pipe       = pipe;
     Pipe.Connect();
 }
Exemple #2
0
        public PipeProxy(NamedPipeChannelDefinition definition, IDispatcher dispatch, IMessageSerializer messageSerializer)
        {
            Definition  = definition;
            Dispatcher  = dispatch;
            Serializer  = messageSerializer;
            PipeFactory = new PipeEndpointFactory();
            Pipe        = PipeFactory.CreateEndpointForChannel(definition);

            RingBuffer = new RingBuffer(1000);
            RingBuffer.AddTransform(DeserializeMessage);
            RingBuffer.AddTransform(DispatchResult);
            RingBuffer.Start();
        }
        public IPipeEndpoint CreateEndpointForChannel(NamedPipeChannelDefinition definition)
        {
            if ( definition.IsServer )
            {
                var stream = new NamedPipeServerStream(
                    definition.PipeName, 
                    PipeDirection.InOut,
                    NamedPipeServerStream.MaxAllowedServerInstances,
                    PipeTransmissionMode.Message, 
                    PipeOptions.Asynchronous,
                    definition.BufferSize,
                    definition.BufferSize);

                return new ServerPipeEndpoint( stream );
            }
            else
            {
                return new ClientPipeEndpoint( definition );
            }
        }
        public IPipeEndpoint CreateEndpointForChannel(NamedPipeChannelDefinition definition)
        {
            if (definition.IsServer)
            {
                var stream = new NamedPipeServerStream(
                    definition.PipeName,
                    PipeDirection.InOut,
                    NamedPipeServerStream.MaxAllowedServerInstances,
                    PipeTransmissionMode.Message,
                    PipeOptions.Asynchronous,
                    definition.BufferSize,
                    definition.BufferSize);

                return(new ServerPipeEndpoint(stream));
            }
            else
            {
                return(new ClientPipeEndpoint(definition));
            }
        }
 public NamedPipeChannelConfigurator()
 {
     Definition = new NamedPipeChannelDefinition();
 }
 public ClientPipeEndpoint( NamedPipeChannelDefinition definition )
 {
     Definition = definition;
 }
 public NamedPipeChannelConfigurator()
 {
     Definition = new NamedPipeChannelDefinition();
 }
Exemple #8
0
 public PipeProxy( NamedPipeChannelDefinition definition, IDispatcher dispatch, IMessageSerializer messageSerializer )
 {
     Definition = definition;
     Dispatcher = dispatch;
     Serializer = messageSerializer;
     PipeFactory = new PipeEndpointFactory();
     Pipe = PipeFactory.CreateEndpointForChannel( definition );
     
     RingBuffer = new RingBuffer( 1000 );
     RingBuffer.AddTransform( DeserializeMessage );
     RingBuffer.AddTransform( DispatchResult );
     RingBuffer.Start();
 }
Exemple #9
0
 public ClientPipeEndpoint(NamedPipeChannelDefinition definition)
 {
     Definition = definition;
 }