12
12
13
13
namespace RSocket . Transports
14
14
{
15
+ //TODO Readd transport logging - worth it during debugging.
15
16
public class SocketTransport : IRSocketTransport
16
17
{
17
18
private IPEndPoint Endpoint ;
18
19
private Socket Socket ;
19
20
20
21
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
23
24
24
25
public Uri Url { get ; private set ; }
25
26
private LoggerFactory Logger ;
@@ -36,9 +37,8 @@ public SocketTransport(Uri url, PipeOptions outputoptions = default, PipeOptions
36
37
if ( url . Port == - 1 ) { throw new ArgumentException ( "TCP Port must be specified." , nameof ( Url ) ) ; }
37
38
38
39
//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 ( ) } ) ;
40
41
( Front , Back ) = DuplexPipe . CreatePair ( outputoptions , inputoptions ) ;
41
- //Transport = new SocketsTransport(Options, Back, WebSocketsTransport.HttpConnectionContext.Default, Logger);
42
42
}
43
43
44
44
public async Task ConnectAsync ( CancellationToken cancel = default )
@@ -125,7 +125,7 @@ private async Task ProcessSocketAsync(Socket socket)
125
125
126
126
private async Task StartReceiving ( Socket socket )
127
127
{
128
- var token = Cancellation ? . Token ?? default ;
128
+ var token = default ( CancellationToken ) ; // Cancellation?.Token ?? default;
129
129
130
130
try
131
131
{
0 commit comments