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
        IRSocketServerConfigurationBuilder IRSocketServerConfigurationBuilder.AddWebSocket()
        {
            var contextAccessor = provider.GetRequiredService <IHttpContextAccessor>();
            var logger          = provider.GetRequiredService <ILogger <WebSocketTransport> >();
            var options         = new WebSocketOptions(TimeSpan.FromMinutes(5.0d));

            transport = new ServerWebSocketTransport(contextAccessor, options, logger);

            return(this);
        }
Exemplo n.º 4
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.º 5
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.º 6
0
        protected IDisposable ChannelSubscription;                      //TODO Tracking state for channels

        public RSocketClient(IRSocketTransport transport, RSocketClientOptions options = default)
        {
            Transport = transport;
            Options   = options ?? RSocketClientOptions.Default;
            //TODO Fluent options method here with copied default. Oh, and the default should probably be immutable.
        }
Exemplo n.º 7
0
 public RSocket(IRSocketTransport transport, PrefetchOptions options = default)
 {
     this.Transport = transport;
     this.Options   = options ?? PrefetchOptions.Default;
 }
Exemplo n.º 8
0
 public RSocketClient(IRSocketTransport transport, RSocketOptions options = default)
     : base(transport, options)
 {
     protocolHandler = new ClientProtocolHandler(Dispatcher, Transport.Output, options);
 }
Exemplo n.º 9
0
 protected RSocket(IRSocketTransport transport, RSocketOptions options = default)
 {
     Dispatcher = new RSocketStreamDispatcher();
     Transport  = transport;
     Options    = options ?? RSocketOptions.Default;
 }
Exemplo n.º 10
0
 public EchoServer(IRSocketTransport transport, RSocketOptions options = default, int echoes = 2)
     : base(transport, options)
 {
 }
Exemplo n.º 11
0
 public EchoRSocketClient(IRSocketTransport transport, RSocketOptions options = default) : base(transport, options)
 {
 }
Exemplo n.º 12
0
 public EchoServer(IRSocketTransport transport, RSocketOptions options = default, int echoes = 2) : base(transport, options)
 {
     this._echoes  = echoes;
     this.Streamer = this.ForRequestStream;
 }
Exemplo n.º 13
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.º 14
0
 public RSocketDemoClient(IRSocketTransport transport, RSocketOptions options = default) : base(transport, options)
 {
     this.FireAndForgetHandler = this.ForRequestFireAndForget;
 }
Exemplo n.º 15
0
 public RSocketServer(IRSocketTransport transport, PrefetchOptions options = default) : base(transport, options)
 {
 }
Exemplo n.º 16
0
 public RSocketServerConfiguration(IRSocketTransport transport)
 {
     Transport = transport;
     Options   = new RSocketOptions();
 }
Exemplo n.º 17
0
 public RSocketClientReactive(IRSocketTransport transport, RSocketClientOptions options = default) : base(transport, options)
 {
 }
Exemplo n.º 18
0
 public TestServer(IRSocketTransport transport) : base(transport)
 {
 }
Exemplo n.º 19
0
        protected IDisposable ChannelSubscription;              //TODO Tracking state for channels

        public RSocket(IRSocketTransport transport, RSocketOptions options = default)
        {
            Transport = transport;
            Options   = options ?? RSocketOptions.Default;
        }
Exemplo n.º 20
0
 public RSocketClient(IRSocketTransport transport, RSocketOptions options = default) : base(transport, options)
 {
     this.Options = options ?? RSocketOptions.Default;
 }