Exemplo n.º 1
0
 public BrokerClient(
     long accessKey,
     string accessToken,
     Guid?connectionId,
     IPAddress ipAddress,
     string group,
     string destination,
     short additionalFlags,
     SortedDictionary <string, string> tags,
     IRSocketTransport transport,
     RSocketOptions options)
 {
     this.accessKey       = accessKey;
     this.accessToken     = Convert.FromBase64String(accessToken);
     this.connectionId    = connectionId.GetValueOrDefault(Guid.NewGuid());
     this.ipAddress       = ipAddress;
     this.group           = group;
     this.destination     = destination ?? DEFAULT_DESTINATION;
     this.additionalFlags = additionalFlags;
     this.tags            = tags;
     this.tags.Add("com.netifi.destination", this.destination);
     this.transport = transport;
     this.options   = options;
     this.client    = new RSocketClient(transport, options);
 }
 public RSocketDemoServer(IRSocketTransport transport, RSocketOptions options = default)
     : base(transport, options)
 {
     this.FireAndForgetHandler = this.ForRequestFireAndForget;
     this.Responder            = this.ForRequestResponse;
     this.Streamer             = this.ForRequestStream;
     this.Channeler            = this.ForRequestChannel;
 }
Exemplo n.º 3
0
 public ShopMeServer(
     IRSocketTransport transport,
     RSocketOptions options,
     ILogger <ShopMeServer> logger)
     : base(transport, options, logger)
 {
     Stream(
         request => request,
         request => AsyncEnumerable.Create(ShopLists),
         result => (result, ReadOnlySequence <byte> .Empty)
         );
 }
Exemplo n.º 4
0
        public EchoServer(IRSocketTransport transport, RSocketOptions options = default, int echoes = 2)
            : base(transport, options)
        {
            // Request/Response
            Respond(
                request => request,                                 // requestTransform
                request => AsyncEnumerable.Repeat(request, echoes), // producer
                result => result                                    // resultTransform
                );

            // Request/Stream
            Stream(
                request => request,                                 // requestTransform
                request => AsyncEnumerable.Repeat(request, echoes), // producer
                result => result                                    // resultTransform
                );
        }
Exemplo n.º 5
0
 public EchoServer(IRSocketTransport transport, RSocketOptions options = default, int echoes = 2)
     : base(transport, options)
 {
 }
Exemplo n.º 6
0
 public RSocketClientReactive(IRSocketTransport transport, RSocketOptions options = default) : base(transport, options)
 {
 }
Exemplo n.º 7
0
 public RSocketServerConfiguration(IRSocketTransport transport)
 {
     Transport = transport;
     Options   = new RSocketOptions();
 }
 public EchoRSocketClient(IRSocketTransport transport, RSocketOptions options = default) : base(transport, options)
 {
 }
Exemplo n.º 9
0
 public ClientProtocolHandler(RSocketStreamDispatcher dispatcher, PipeWriter pipe, RSocketOptions options)
     : base(dispatcher, -1, pipe)
 {
     this.options = options;
 }
Exemplo n.º 10
0
 public EchoServer(IRSocketTransport transport, RSocketOptions options = default, int echoes = 2) : base(transport, options)
 {
     this._echoes  = echoes;
     this.Streamer = this.ForRequestStream;
 }
Exemplo n.º 11
0
 public EchoServer(IRSocketTransport transport, RSocketOptions options = default, int echoes = 2) : base(transport, options)
 {
     Stream(request => request,
            request => AsyncEnumerable.Repeat(request, echoes),
            result => result);
 }
Exemplo n.º 12
0
 public RSocketDemoClient(IRSocketTransport transport, RSocketOptions options = default) : base(transport, options)
 {
     this.FireAndForgetHandler = this.ForRequestFireAndForget;
 }