Ejemplo n.º 1
0
        public async Task <RSocketClient> ConnectAsync()
        {
            await Transport.ConnectAsync();

            var server = RSocketProtocol.Handler(this, Transport.Input, CancellationToken.None, name: nameof(RSocketClient));

            ////TODO Move defaults to policy object
            new RSocketProtocol.Setup(keepalive: TimeSpan.FromSeconds(60), lifetime: TimeSpan.FromSeconds(180), metadataMimeType: "binary", dataMimeType: "binary").Write(Transport.Output);
            await Transport.Output.FlushAsync();

            return(this);
        }
Ejemplo n.º 2
0
 /// <summary>Binds the RSocket to its Transport and begins handling messages.</summary>
 /// <param name="cancel">Cancellation for the handler. Requesting cancellation will stop message handling.</param>
 /// <returns>The handler task.</returns>
 public Task Connect(CancellationToken cancel = default) => RSocketProtocol.Handler(this, Transport.Input, cancel);
Ejemplo n.º 3
0
 public void Start(CancellationToken cancel = default)
 {
     Handler = RSocketProtocol.Handler(this, Transport.Input, cancel, name: nameof(RSocketServer));
 }