Skip to content

Commit 5ae6b32

Browse files
Friendly fixes for RSocketClient.ConnectAsync() - since this is a low-frequency call, no harm in taking the byte[] primitive.
1 parent 5f41d1a commit 5ae6b32

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: RSocket.Core/RSocketClient.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ public class RSocketClient : RSocket
2020

2121
public RSocketClient(IRSocketTransport transport, RSocketOptions options = default) : base(transport, options) { }
2222

23-
public Task ConnectAsync(RSocketOptions options = default, byte[] data = default, byte[] metadata = default) => ConnectAsync(options, data: data == default ? default : new ReadOnlySequence<byte>(data), metadata: metadata == default ? default : new ReadOnlySequence<byte>(metadata));
23+
public Task ConnectAsync(RSocketOptions options = default, byte[] data = default, byte[] metadata = default) => ConnectAsync(options ?? RSocketOptions.Default, data: data == default ? default : new ReadOnlySequence<byte>(data), metadata: metadata == default ? default : new ReadOnlySequence<byte>(metadata));
2424

25-
public async Task ConnectAsync(RSocketOptions options = default, ReadOnlySequence<byte> metadata = default, ReadOnlySequence<byte> data = default)
25+
async Task ConnectAsync(RSocketOptions options, ReadOnlySequence<byte> metadata, ReadOnlySequence<byte> data)
2626
{
27-
options = options ?? RSocketOptions.Default;
2827
await Transport.StartAsync();
2928
Handler = Connect(CancellationToken.None);
3029
await Setup(options.KeepAlive, options.Lifetime, options.MetadataMimeType, options.DataMimeType, data: data, metadata: metadata);

0 commit comments

Comments
 (0)