Skip to content

Commit 15dcff7

Browse files
Updates to use CallerMemberName for method signatures in generated code. Fixes to remove warnings.
1 parent c25feea commit 15dcff7

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

RSocket.Core/Transports/SocketTransport.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212

1313
namespace RSocket.Transports
1414
{
15+
//TODO Readd transport logging - worth it during debugging.
1516
public class SocketTransport : IRSocketTransport
1617
{
1718
private IPEndPoint Endpoint;
1819
private Socket Socket;
1920

2021
internal Task Running { get; private set; } = Task.CompletedTask;
21-
private CancellationTokenSource Cancellation;
22-
private volatile bool Aborted;
22+
//private CancellationTokenSource Cancellation;
23+
private volatile bool Aborted; //TODO Implement cooperative cancellation
2324

2425
public Uri Url { get; private set; }
2526
private LoggerFactory Logger;
@@ -36,9 +37,8 @@ public SocketTransport(Uri url, PipeOptions outputoptions = default, PipeOptions
3637
if (url.Port == -1) { throw new ArgumentException("TCP Port must be specified.", nameof(Url)); }
3738

3839
//Options = options ?? WebSocketsTransport.DefaultWebSocketOptions;
39-
//Logger = new Microsoft.Extensions.Logging.LoggerFactory(new[] { new Microsoft.Extensions.Logging.Debug.DebugLoggerProvider() });
40+
Logger = new Microsoft.Extensions.Logging.LoggerFactory(new[] { new Microsoft.Extensions.Logging.Debug.DebugLoggerProvider() });
4041
(Front, Back) = DuplexPipe.CreatePair(outputoptions, inputoptions);
41-
//Transport = new SocketsTransport(Options, Back, WebSocketsTransport.HttpConnectionContext.Default, Logger);
4242
}
4343

4444
public async Task ConnectAsync(CancellationToken cancel = default)
@@ -125,7 +125,7 @@ private async Task ProcessSocketAsync(Socket socket)
125125

126126
private async Task StartReceiving(Socket socket)
127127
{
128-
var token = Cancellation?.Token ?? default;
128+
var token = default(CancellationToken); //Cancellation?.Token ?? default;
129129

130130
try
131131
{

RSocket.RPC/RSocketRPCClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace RSocket.RPC
88
{
9+
//TODO This has probably dissolved into the Service base class at this point.
910
public class RSocketRPCClient
1011
{
1112
readonly RSocketClient Client;

RSocketRPCSample/EchoService.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ namespace RSocketRPCSample
55
using System.Threading.Tasks;
66
using RSocket;
77
using RSocket.RPC;
8-
using Google.Protobuf.WellKnownTypes;
98

109
[System.Runtime.CompilerServices.CompilerGenerated]
1110
interface IEchoService
@@ -29,17 +28,7 @@ public class EchoService : RSocketService<EchoService>, IEchoService
2928

3029
public EchoService(RSocketClient client) : base(client) { }
3130

32-
//TODO Consider CallerMemberName because the servicename is basically fixed. Also, consider static class...
33-
public Task<BytesValue> requestResponse(BytesValue message, ReadOnlySequence<byte> metadata = default) => __RequestResponse(message, Google.Protobuf.MessageExtensions.ToByteArray, BytesValue.Parser.ParseFrom, metadata, service: SERVICE);
34-
35-
36-
37-
//async Task ASD()
38-
//{
39-
// var thing = new System.Buffers.ReadOnlySequence<byte>(new byte[0]);
40-
// //var result = await requestResponse(thing, thing);
41-
// return 3;
42-
//}
31+
public Task<Google.Protobuf.WellKnownTypes.BytesValue> requestResponse(Google.Protobuf.WellKnownTypes.BytesValue message, ReadOnlySequence<byte> metadata = default) => __RequestResponse(message, Google.Protobuf.MessageExtensions.ToByteArray, Google.Protobuf.WellKnownTypes.BytesValue.Parser.ParseFrom, metadata, service: SERVICE);
4332

4433
//public void fireAndForget(ReadOnlySequence<byte> data, ReadOnlySequence<byte> metadata = default) { Client.RequestFireAndForget(null, data, metadata); }
4534

0 commit comments

Comments
 (0)