From d50e6ab5bb19f046ebb06b9c9a3055eb8420770b Mon Sep 17 00:00:00 2001 From: Eduard Dumitru Date: Tue, 26 Nov 2024 10:20:17 +0100 Subject: [PATCH] taking shape --- src/UiPath.CoreIpc/Connection.cs | 4 +- src/UiPath.CoreIpc/Helpers/NestedStream.cs | 4 +- src/UiPath.CoreIpc/PublicAPI.Shipped.txt | 177 ++++++++++++++++++ src/UiPath.CoreIpc/PublicAPI.Unshipped.txt | 1 + src/UiPath.CoreIpc/Server/Server.cs | 2 +- .../UiPath.Ipc.net6.0-windows.received.txt | 135 +++++++------ 6 files changed, 247 insertions(+), 76 deletions(-) create mode 100644 src/UiPath.CoreIpc/PublicAPI.Shipped.txt create mode 100644 src/UiPath.CoreIpc/PublicAPI.Unshipped.txt diff --git a/src/UiPath.CoreIpc/Connection.cs b/src/UiPath.CoreIpc/Connection.cs index be2b3bde..3959f01e 100644 --- a/src/UiPath.CoreIpc/Connection.cs +++ b/src/UiPath.CoreIpc/Connection.cs @@ -364,7 +364,7 @@ private void OnCancellationReceived(CancellationRequest cancellationRequest) { try { - CancellationReceived(cancellationRequest.RequestId); + CancellationReceived?.Invoke(cancellationRequest.RequestId); } catch (Exception ex) { @@ -380,7 +380,7 @@ private async Task OnRequestReceivedAsyncSafe(Request request) { try { - await RequestReceived(request); + await (RequestReceived?.Invoke(request) ?? default); } catch (Exception ex) { diff --git a/src/UiPath.CoreIpc/Helpers/NestedStream.cs b/src/UiPath.CoreIpc/Helpers/NestedStream.cs index 2e69166e..a726678d 100644 --- a/src/UiPath.CoreIpc/Helpers/NestedStream.cs +++ b/src/UiPath.CoreIpc/Helpers/NestedStream.cs @@ -35,7 +35,7 @@ public void Reset(long length) _length = length; } - public event EventHandler Disposed; + public event EventHandler? Disposed; /// public bool IsDisposed => _underlyingStream == null; /// @@ -148,7 +148,7 @@ protected override void Dispose(bool disposing) if (_remainingBytes != 0) { _underlyingStream?.Dispose(); - _underlyingStream = null; + _underlyingStream = null!; } Disposed?.Invoke(this, EventArgs.Empty); base.Dispose(disposing); diff --git a/src/UiPath.CoreIpc/PublicAPI.Shipped.txt b/src/UiPath.CoreIpc/PublicAPI.Shipped.txt new file mode 100644 index 00000000..3a9b8f82 --- /dev/null +++ b/src/UiPath.CoreIpc/PublicAPI.Shipped.txt @@ -0,0 +1,177 @@ +#nullable enable +abstract UiPath.Ipc.ClientTransport.CreateState() -> UiPath.Ipc.IClientState! +abstract UiPath.Ipc.ClientTransport.Validate() -> void +abstract UiPath.Ipc.ServerTransport.CreateServerState() -> UiPath.Ipc.ServerTransport.IServerState! +abstract UiPath.Ipc.ServerTransport.ValidateCore() -> System.Collections.Generic.IEnumerable! +override UiPath.Ipc.EndpointSettings.WithServiceProvider(System.IServiceProvider? serviceProvider) -> UiPath.Ipc.EndpointSettings! +override UiPath.Ipc.Error.ToString() -> string! +override UiPath.Ipc.IpcProxy.Invoke(System.Reflection.MethodInfo? targetMethod, object?[]? args) -> object? +override UiPath.Ipc.RemoteException.StackTrace.get -> string! +override UiPath.Ipc.RemoteException.ToString() -> string! +override UiPath.Ipc.Transport.NamedPipe.NamedPipeClientTransport.CreateState() -> UiPath.Ipc.IClientState! +override UiPath.Ipc.Transport.NamedPipe.NamedPipeClientTransport.ToString() -> string! +override UiPath.Ipc.Transport.NamedPipe.NamedPipeClientTransport.Validate() -> void +override UiPath.Ipc.Transport.NamedPipe.NamedPipeServerTransport.ToString() -> string! +override UiPath.Ipc.Transport.Tcp.TcpClientTransport.CreateState() -> UiPath.Ipc.IClientState! +override UiPath.Ipc.Transport.Tcp.TcpClientTransport.ToString() -> string! +override UiPath.Ipc.Transport.Tcp.TcpClientTransport.Validate() -> void +override UiPath.Ipc.Transport.Tcp.TcpServerTransport.ToString() -> string! +override UiPath.Ipc.Transport.WebSocket.WebSocketClientTransport.CreateState() -> UiPath.Ipc.IClientState! +override UiPath.Ipc.Transport.WebSocket.WebSocketClientTransport.ToString() -> string! +override UiPath.Ipc.Transport.WebSocket.WebSocketClientTransport.Validate() -> void +override UiPath.Ipc.Transport.WebSocket.WebSocketServerTransport.ToString() -> string! +static UiPath.Ipc.Error.FromException(System.Exception? exception) -> UiPath.Ipc.Error? +static UiPath.Ipc.IOHelpers.Allow(this System.IO.Pipes.PipeSecurity! pipeSecurity, System.Security.Principal.IdentityReference! sid, System.IO.Pipes.PipeAccessRights pipeAccessRights) -> System.IO.Pipes.PipeSecurity! +static UiPath.Ipc.IOHelpers.Allow(this System.IO.Pipes.PipeSecurity! pipeSecurity, System.Security.Principal.WellKnownSidType sid, System.IO.Pipes.PipeAccessRights pipeAccessRights) -> System.IO.Pipes.PipeSecurity! +static UiPath.Ipc.IOHelpers.AllowCurrentUser(this System.IO.Pipes.PipeSecurity! pipeSecurity, bool onlyNonAdmin = false) -> System.IO.Pipes.PipeSecurity! +static UiPath.Ipc.IOHelpers.Deny(this System.IO.Pipes.PipeSecurity! pipeSecurity, System.Security.Principal.IdentityReference! sid, System.IO.Pipes.PipeAccessRights pipeAccessRights) -> System.IO.Pipes.PipeSecurity! +static UiPath.Ipc.IOHelpers.Deny(this System.IO.Pipes.PipeSecurity! pipeSecurity, System.Security.Principal.WellKnownSidType sid, System.IO.Pipes.PipeAccessRights pipeAccessRights) -> System.IO.Pipes.PipeSecurity! +static UiPath.Ipc.IOHelpers.LocalOnly(this System.IO.Pipes.PipeSecurity! pipeSecurity) -> System.IO.Pipes.PipeSecurity! +static UiPath.Ipc.IOHelpers.PipeExists(string! pipeName, int timeout = 1) -> bool +static UiPath.Ipc.ServerTransport.IsNotNull(T? propertyValue, string? propertyName = null) -> string? +UiPath.Ipc.CallInfo +UiPath.Ipc.CallInfo.Arguments.get -> object?[]! +UiPath.Ipc.CallInfo.CallInfo() -> void +UiPath.Ipc.CallInfo.CallInfo(bool newConnection, System.Reflection.MethodInfo! method, object?[]! arguments) -> void +UiPath.Ipc.CallInfo.Method.get -> System.Reflection.MethodInfo! +UiPath.Ipc.CallInfo.NewConnection.get -> bool +UiPath.Ipc.ClientTransport +UiPath.Ipc.EndpointCollection +UiPath.Ipc.EndpointCollection.Add(System.Type! contractType, object? instance) -> void +UiPath.Ipc.EndpointCollection.Add(System.Type! type) -> void +UiPath.Ipc.EndpointCollection.Add(UiPath.Ipc.EndpointSettings! endpointSettings) -> void +UiPath.Ipc.EndpointCollection.EndpointCollection() -> void +UiPath.Ipc.EndpointCollection.GetEnumerator() -> System.Collections.Generic.IEnumerator! +UiPath.Ipc.EndpointNotFoundException +UiPath.Ipc.EndpointNotFoundException.EndpointName.get -> string! +UiPath.Ipc.EndpointNotFoundException.EndpointNotFoundException(string! paramName, string! serverDebugName, string! endpointName) -> void +UiPath.Ipc.EndpointNotFoundException.ServerDebugName.get -> string! +UiPath.Ipc.EndpointSettings +UiPath.Ipc.EndpointSettings.BeforeIncommingCall.get -> System.Func? +UiPath.Ipc.EndpointSettings.BeforeIncommingCall.set -> void +UiPath.Ipc.EndpointSettings.ContractType.get -> System.Type! +UiPath.Ipc.EndpointSettings.EndpointSettings(System.Type! contractType, object? serviceInstance = null) -> void +UiPath.Ipc.EndpointSettings.EndpointSettings(System.Type! contractType, System.IServiceProvider! serviceProvider) -> void +UiPath.Ipc.EndpointSettings.Scheduler.get -> System.Threading.Tasks.TaskScheduler? +UiPath.Ipc.EndpointSettings.Scheduler.set -> void +UiPath.Ipc.EndpointSettings.ServiceInstance.get -> object? +UiPath.Ipc.EndpointSettings.ServiceProvider.get -> System.IServiceProvider? +UiPath.Ipc.EndpointSettings.Validate() -> void +UiPath.Ipc.EndpointSettings +UiPath.Ipc.EndpointSettings.EndpointSettings(System.IServiceProvider! serviceProvider) -> void +UiPath.Ipc.EndpointSettings.EndpointSettings(TContract? serviceInstance = null) -> void +UiPath.Ipc.Error +UiPath.Ipc.Error.Error(string! Message, string! StackTrace, string! Type, UiPath.Ipc.Error? InnerError) -> void +UiPath.Ipc.Error.InnerError.get -> UiPath.Ipc.Error? +UiPath.Ipc.Error.InnerError.init -> void +UiPath.Ipc.Error.Message.get -> string! +UiPath.Ipc.Error.Message.init -> void +UiPath.Ipc.Error.StackTrace.get -> string! +UiPath.Ipc.Error.StackTrace.init -> void +UiPath.Ipc.Error.Type.get -> string! +UiPath.Ipc.Error.Type.init -> void +UiPath.Ipc.IClient +UiPath.Ipc.IClient.GetCallback() -> TCallbackInterface! +UiPath.Ipc.IClient.Impersonate(System.Action! action) -> void +UiPath.Ipc.IClientState +UiPath.Ipc.IClientState.Connect(UiPath.Ipc.IpcClient! client, System.Threading.CancellationToken ct) -> System.Threading.Tasks.ValueTask +UiPath.Ipc.IClientState.IsConnected() -> bool +UiPath.Ipc.IClientState.Network.get -> System.IO.Stream? +UiPath.Ipc.IOHelpers +UiPath.Ipc.IpcClient +UiPath.Ipc.IpcClient.BeforeConnect.get -> System.Func? +UiPath.Ipc.IpcClient.BeforeConnect.set -> void +UiPath.Ipc.IpcClient.BeforeOutgoingCall.get -> System.Func? +UiPath.Ipc.IpcClient.BeforeOutgoingCall.set -> void +UiPath.Ipc.IpcClient.Callbacks.get -> UiPath.Ipc.EndpointCollection? +UiPath.Ipc.IpcClient.Callbacks.set -> void +UiPath.Ipc.IpcClient.DebugName.get -> string! +UiPath.Ipc.IpcClient.DebugName.set -> void +UiPath.Ipc.IpcClient.GetProxy() -> TProxy! +UiPath.Ipc.IpcClient.IpcClient() -> void +UiPath.Ipc.IpcClient.Logger.get -> Microsoft.Extensions.Logging.ILogger? +UiPath.Ipc.IpcClient.Logger.init -> void +UiPath.Ipc.IpcClient.Transport.get -> UiPath.Ipc.ClientTransport! +UiPath.Ipc.IpcClient.Transport.init -> void +UiPath.Ipc.IpcProxy +UiPath.Ipc.IpcProxy.CloseConnection() -> System.Threading.Tasks.ValueTask +UiPath.Ipc.IpcProxy.ConnectionClosed -> System.EventHandler! +UiPath.Ipc.IpcProxy.Dispose() -> void +UiPath.Ipc.IpcProxy.IpcProxy() -> void +UiPath.Ipc.IpcProxy.Network.get -> System.IO.Stream? +UiPath.Ipc.IpcServer +UiPath.Ipc.IpcServer.DisposeAsync() -> System.Threading.Tasks.ValueTask +UiPath.Ipc.IpcServer.Endpoints.get -> UiPath.Ipc.EndpointCollection! +UiPath.Ipc.IpcServer.Endpoints.init -> void +UiPath.Ipc.IpcServer.IpcServer() -> void +UiPath.Ipc.IpcServer.Start() -> void +UiPath.Ipc.IpcServer.Transport.get -> UiPath.Ipc.ServerTransport! +UiPath.Ipc.IpcServer.Transport.init -> void +UiPath.Ipc.IpcServer.WaitForStart() -> System.Threading.Tasks.Task! +UiPath.Ipc.IpcServer.WaitForStop() -> System.Threading.Tasks.Task! +UiPath.Ipc.Message +UiPath.Ipc.Message.Client.get -> UiPath.Ipc.IClient! +UiPath.Ipc.Message.Client.set -> void +UiPath.Ipc.Message.GetCallback() -> TCallbackInterface! +UiPath.Ipc.Message.ImpersonateClient(System.Action! action) -> void +UiPath.Ipc.Message.Message() -> void +UiPath.Ipc.Message.RequestTimeout.get -> System.TimeSpan +UiPath.Ipc.Message.RequestTimeout.set -> void +UiPath.Ipc.Message +UiPath.Ipc.Message.Message(TPayload payload) -> void +UiPath.Ipc.Message.Payload.get -> TPayload +UiPath.Ipc.Peer +UiPath.Ipc.Peer.Peer() -> void +UiPath.Ipc.Peer.RequestTimeout.get -> System.TimeSpan +UiPath.Ipc.Peer.RequestTimeout.set -> void +UiPath.Ipc.Peer.Scheduler.get -> System.Threading.Tasks.TaskScheduler? +UiPath.Ipc.Peer.Scheduler.set -> void +UiPath.Ipc.Peer.ServiceProvider.get -> System.IServiceProvider? +UiPath.Ipc.Peer.ServiceProvider.set -> void +UiPath.Ipc.RemoteException +UiPath.Ipc.RemoteException.InnerException.get -> UiPath.Ipc.RemoteException? +UiPath.Ipc.RemoteException.Is() -> bool +UiPath.Ipc.RemoteException.RemoteException(UiPath.Ipc.Error! error) -> void +UiPath.Ipc.RemoteException.Type.get -> string! +UiPath.Ipc.ServerTransport +UiPath.Ipc.ServerTransport.Certificate.get -> System.Security.Cryptography.X509Certificates.X509Certificate? +UiPath.Ipc.ServerTransport.Certificate.init -> void +UiPath.Ipc.ServerTransport.ConcurrentAccepts.get -> int +UiPath.Ipc.ServerTransport.ConcurrentAccepts.set -> void +UiPath.Ipc.ServerTransport.IServerConnectionSlot +UiPath.Ipc.ServerTransport.IServerConnectionSlot.AwaitConnection(System.Threading.CancellationToken ct) -> System.Threading.Tasks.ValueTask +UiPath.Ipc.ServerTransport.IServerState +UiPath.Ipc.ServerTransport.IServerState.CreateConnectionSlot() -> UiPath.Ipc.ServerTransport.IServerConnectionSlot! +UiPath.Ipc.ServerTransport.MaxReceivedMessageSizeInMegabytes.get -> byte +UiPath.Ipc.ServerTransport.MaxReceivedMessageSizeInMegabytes.set -> void +UiPath.Ipc.ServerTransport.ServerTransport() -> void +UiPath.Ipc.Transport.NamedPipe.NamedPipeClientTransport +UiPath.Ipc.Transport.NamedPipe.NamedPipeClientTransport.AllowImpersonation.get -> bool +UiPath.Ipc.Transport.NamedPipe.NamedPipeClientTransport.AllowImpersonation.init -> void +UiPath.Ipc.Transport.NamedPipe.NamedPipeClientTransport.PipeName.get -> string! +UiPath.Ipc.Transport.NamedPipe.NamedPipeClientTransport.PipeName.init -> void +UiPath.Ipc.Transport.NamedPipe.NamedPipeClientTransport.ServerName.get -> string! +UiPath.Ipc.Transport.NamedPipe.NamedPipeClientTransport.ServerName.init -> void +UiPath.Ipc.Transport.NamedPipe.NamedPipeServerTransport +UiPath.Ipc.Transport.NamedPipe.NamedPipeServerTransport.AccessControl.get -> System.Action? +UiPath.Ipc.Transport.NamedPipe.NamedPipeServerTransport.AccessControl.init -> void +UiPath.Ipc.Transport.NamedPipe.NamedPipeServerTransport.NamedPipeServerTransport() -> void +UiPath.Ipc.Transport.NamedPipe.NamedPipeServerTransport.PipeName.get -> string! +UiPath.Ipc.Transport.NamedPipe.NamedPipeServerTransport.PipeName.init -> void +UiPath.Ipc.Transport.NamedPipe.NamedPipeServerTransport.ServerName.get -> string! +UiPath.Ipc.Transport.NamedPipe.NamedPipeServerTransport.ServerName.init -> void +UiPath.Ipc.Transport.Tcp.TcpClientTransport +UiPath.Ipc.Transport.Tcp.TcpClientTransport.EndPoint.get -> System.Net.IPEndPoint! +UiPath.Ipc.Transport.Tcp.TcpClientTransport.EndPoint.init -> void +UiPath.Ipc.Transport.Tcp.TcpServerTransport +UiPath.Ipc.Transport.Tcp.TcpServerTransport.EndPoint.get -> System.Net.IPEndPoint! +UiPath.Ipc.Transport.Tcp.TcpServerTransport.EndPoint.init -> void +UiPath.Ipc.Transport.Tcp.TcpServerTransport.TcpServerTransport() -> void +UiPath.Ipc.Transport.WebSocket.WebSocketClientTransport +UiPath.Ipc.Transport.WebSocket.WebSocketClientTransport.Uri.get -> System.Uri! +UiPath.Ipc.Transport.WebSocket.WebSocketClientTransport.Uri.init -> void +UiPath.Ipc.Transport.WebSocket.WebSocketServerTransport +UiPath.Ipc.Transport.WebSocket.WebSocketServerTransport.Accept.get -> System.Func!>! +UiPath.Ipc.Transport.WebSocket.WebSocketServerTransport.Accept.init -> void +UiPath.Ipc.Transport.WebSocket.WebSocketServerTransport.WebSocketServerTransport() -> void +virtual UiPath.Ipc.EndpointSettings.WithServiceProvider(System.IServiceProvider? serviceProvider) -> UiPath.Ipc.EndpointSettings! \ No newline at end of file diff --git a/src/UiPath.CoreIpc/PublicAPI.Unshipped.txt b/src/UiPath.CoreIpc/PublicAPI.Unshipped.txt new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/UiPath.CoreIpc/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/UiPath.CoreIpc/Server/Server.cs b/src/UiPath.CoreIpc/Server/Server.cs index 16b1e691..e49f8164 100644 --- a/src/UiPath.CoreIpc/Server/Server.cs +++ b/src/UiPath.CoreIpc/Server/Server.cs @@ -226,7 +226,7 @@ void Deserialize() } if (argument is Message message) { - message.Client = _client; + message.Client = _client!; } return argument; } diff --git a/src/UiPath.CoreIpc/report/UiPath.Ipc.net6.0-windows.received.txt b/src/UiPath.CoreIpc/report/UiPath.Ipc.net6.0-windows.received.txt index c99c698a..a866328c 100644 --- a/src/UiPath.CoreIpc/report/UiPath.Ipc.net6.0-windows.received.txt +++ b/src/UiPath.CoreIpc/report/UiPath.Ipc.net6.0-windows.received.txt @@ -16,18 +16,6 @@ namespace UiPath.Ipc public System.Reflection.MethodInfo Method { get; } public bool NewConnection { get; } } - public sealed class ClientConfig : UiPath.Ipc.EndpointConfig, System.IEquatable - { - public ClientConfig() { } - public string DebugName { get; set; } - public UiPath.Ipc.ISerializer? Serializer { get; set; } - public System.Func? BeforeCall { get; init; } - public System.Func? BeforeConnect { get; init; } - public UiPath.Ipc.EndpointCollection? Callbacks { get; init; } - public Microsoft.Extensions.Logging.ILogger? Logger { get; init; } - public System.Threading.Tasks.TaskScheduler? Scheduler { get; init; } - public System.IServiceProvider? ServiceProvider { get; init; } - } public abstract class ClientTransport : System.IEquatable { protected ClientTransport() { } @@ -42,11 +30,6 @@ namespace UiPath.Ipc public void Add(System.Type contractType, object? instance) { } public System.Collections.Generic.IEnumerator GetEnumerator() { } } - public abstract class EndpointConfig : System.IEquatable - { - protected EndpointConfig() { } - public System.TimeSpan RequestTimeout { get; init; } - } [System.Serializable] public sealed class EndpointNotFoundException : System.ArgumentOutOfRangeException { @@ -58,7 +41,7 @@ namespace UiPath.Ipc { public EndpointSettings(System.Type contractType, System.IServiceProvider serviceProvider) { } public EndpointSettings(System.Type contractType, object? serviceInstance = null) { } - public System.Func? BeforeCall { get; set; } + public System.Func? BeforeIncommingCall { get; set; } public System.Type ContractType { get; } public System.Threading.Tasks.TaskScheduler? Scheduler { get; set; } public object? ServiceInstance { get; } @@ -107,19 +90,16 @@ namespace UiPath.Ipc public static System.IO.Pipes.PipeSecurity LocalOnly(this System.IO.Pipes.PipeSecurity pipeSecurity) { } public static bool PipeExists(string pipeName, int timeout = 1) { } } - public interface ISerializer - { - object? Deserialize(string json, System.Type type); - System.Threading.Tasks.ValueTask DeserializeAsync(System.IO.Stream json, Microsoft.Extensions.Logging.ILogger? logger); - string Serialize(object? obj); - void Serialize(object? obj, System.IO.Stream stream); - } - public sealed class IpcClient + public sealed class IpcClient : UiPath.Ipc.Peer { [System.Obsolete("Constructors of types with required members are not supported in this version of " + "your compiler.", true)] public IpcClient() { } - public UiPath.Ipc.ClientConfig Config { get; init; } + public System.Func? BeforeConnect { get; set; } + public System.Func? BeforeOutgoingCall { get; set; } + public UiPath.Ipc.EndpointCollection? Callbacks { get; set; } + public string DebugName { get; set; } + public Microsoft.Extensions.Logging.ILogger? Logger { get; init; } public UiPath.Ipc.ClientTransport Transport { get; init; } public TProxy GetProxy() where TProxy : class { } @@ -133,27 +113,21 @@ namespace UiPath.Ipc public void Dispose() { } protected override object? Invoke(System.Reflection.MethodInfo? targetMethod, object?[]? args) { } } - public sealed class IpcServer : System.IAsyncDisposable + public sealed class IpcServer : UiPath.Ipc.Peer, System.IAsyncDisposable { [System.Obsolete("Constructors of types with required members are not supported in this version of " + "your compiler.", true)] public IpcServer() { } public UiPath.Ipc.EndpointCollection Endpoints { get; init; } - public System.Collections.Generic.IReadOnlyList Listeners { get; init; } - public System.Threading.Tasks.TaskScheduler? Scheduler { get; init; } - public System.IServiceProvider ServiceProvider { get; init; } + public UiPath.Ipc.ServerTransport Transport { get; init; } public System.Threading.Tasks.ValueTask DisposeAsync() { } + [System.Diagnostics.CodeAnalysis.MemberNotNull(new string[] { + "Transport", + "_accepter"})] public void Start() { } public System.Threading.Tasks.Task WaitForStart() { } public System.Threading.Tasks.Task WaitForStop() { } } - public abstract class ListenerConfig : UiPath.Ipc.EndpointConfig, System.IEquatable - { - protected ListenerConfig() { } - public System.Security.Cryptography.X509Certificates.X509Certificate? Certificate { get; init; } - public int ConcurrentAccepts { get; init; } - public byte MaxReceivedMessageSizeInMegabytes { get; init; } - } public class Message { public Message() { } @@ -170,6 +144,13 @@ namespace UiPath.Ipc public Message(TPayload payload) { } public TPayload Payload { get; } } + public abstract class Peer + { + protected Peer() { } + public System.TimeSpan RequestTimeout { get; set; } + public System.Threading.Tasks.TaskScheduler? Scheduler { get; set; } + public System.IServiceProvider? ServiceProvider { get; set; } + } [System.Serializable] public class RemoteException : System.Exception { @@ -181,84 +162,96 @@ namespace UiPath.Ipc where TException : System.Exception { } public override string ToString() { } } -} -namespace UiPath.Ipc.Extensibility -{ - public interface IListenerConfig - where TSelf : UiPath.Ipc.ListenerConfig, UiPath.Ipc.Extensibility.IListenerConfig - where TListenerState : System.IAsyncDisposable + public abstract class ServerTransport { - System.Threading.Tasks.ValueTask AwaitConnection(TListenerState listenerState, TConnectionState connectionState, System.Threading.CancellationToken ct); - TConnectionState CreateConnectionState(UiPath.Ipc.IpcServer server, TListenerState listenerState); - TListenerState CreateListenerState(UiPath.Ipc.IpcServer server); - System.Collections.Generic.IEnumerable Validate(); + protected ServerTransport() { } + public int ConcurrentAccepts { get; set; } + public byte MaxReceivedMessageSizeInMegabytes { get; set; } + public System.Security.Cryptography.X509Certificates.X509Certificate? Certificate { get; init; } + protected abstract UiPath.Ipc.ServerTransport.IServerState CreateServerState(); + protected abstract System.Collections.Generic.IEnumerable ValidateCore(); + protected static string? IsNotNull(T? propertyValue, [System.Runtime.CompilerServices.CallerArgumentExpression("propertyValue")] string? propertyName = null) { } + protected interface IServerConnectionSlot : System.IDisposable + { + System.Threading.Tasks.ValueTask AwaitConnection(System.Threading.CancellationToken ct); + } + protected interface IServerState : System.IAsyncDisposable + { + UiPath.Ipc.ServerTransport.IServerConnectionSlot CreateConnectionSlot(); + } } } namespace UiPath.Ipc.Transport.NamedPipe { - public sealed class NamedPipeListener : UiPath.Ipc.ListenerConfig, System.IEquatable, UiPath.Ipc.Extensibility.IListenerConfig + public sealed class NamedPipeClientTransport : UiPath.Ipc.ClientTransport, System.IEquatable { [System.Obsolete("Constructors of types with required members are not supported in this version of " + "your compiler.", true)] - public NamedPipeListener() { } - [Newtonsoft.Json.JsonIgnore] - public System.Action? AccessControl { get; init; } + public NamedPipeClientTransport() { } + public bool AllowImpersonation { get; init; } public string PipeName { get; init; } public string ServerName { get; init; } + public override UiPath.Ipc.IClientState CreateState() { } public override string ToString() { } + public override void Validate() { } } - public sealed class NamedPipeTransport : UiPath.Ipc.ClientTransport, System.IEquatable + public sealed class NamedPipeServerTransport : UiPath.Ipc.ServerTransport { [System.Obsolete("Constructors of types with required members are not supported in this version of " + "your compiler.", true)] - public NamedPipeTransport() { } - public bool AllowImpersonation { get; init; } + public NamedPipeServerTransport() { } + [Newtonsoft.Json.JsonIgnore] + public System.Action? AccessControl { get; init; } public string PipeName { get; init; } public string ServerName { get; init; } - public override UiPath.Ipc.IClientState CreateState() { } + protected override UiPath.Ipc.ServerTransport.IServerState CreateServerState() { } public override string ToString() { } - public override void Validate() { } + protected override System.Collections.Generic.IEnumerable ValidateCore() { } } } namespace UiPath.Ipc.Transport.Tcp { - public sealed class TcpListener : UiPath.Ipc.ListenerConfig, System.IEquatable, UiPath.Ipc.Extensibility.IListenerConfig + public sealed class TcpClientTransport : UiPath.Ipc.ClientTransport, System.IEquatable { [System.Obsolete("Constructors of types with required members are not supported in this version of " + "your compiler.", true)] - public TcpListener() { } + public TcpClientTransport() { } public System.Net.IPEndPoint EndPoint { get; init; } + public override UiPath.Ipc.IClientState CreateState() { } public override string ToString() { } + public override void Validate() { } } - public sealed class TcpTransport : UiPath.Ipc.ClientTransport, System.IEquatable + public sealed class TcpServerTransport : UiPath.Ipc.ServerTransport { [System.Obsolete("Constructors of types with required members are not supported in this version of " + "your compiler.", true)] - public TcpTransport() { } + public TcpServerTransport() { } public System.Net.IPEndPoint EndPoint { get; init; } - public override UiPath.Ipc.IClientState CreateState() { } + protected override UiPath.Ipc.ServerTransport.IServerState CreateServerState() { } public override string ToString() { } - public override void Validate() { } + protected override System.Collections.Generic.IEnumerable ValidateCore() { } } } namespace UiPath.Ipc.Transport.WebSocket { - public sealed class WebSocketListener : UiPath.Ipc.ListenerConfig, System.IEquatable, UiPath.Ipc.Extensibility.IListenerConfig + public sealed class WebSocketClientTransport : UiPath.Ipc.ClientTransport, System.IEquatable { [System.Obsolete("Constructors of types with required members are not supported in this version of " + "your compiler.", true)] - public WebSocketListener() { } - public System.Func> Accept { get; init; } + public WebSocketClientTransport() { } + public System.Uri Uri { get; init; } + public override UiPath.Ipc.IClientState CreateState() { } public override string ToString() { } + public override void Validate() { } } - public sealed class WebSocketTransport : UiPath.Ipc.ClientTransport, System.IEquatable + public sealed class WebSocketServerTransport : UiPath.Ipc.ServerTransport, System.IAsyncDisposable, System.IDisposable, UiPath.Ipc.ServerTransport.IServerConnectionSlot, UiPath.Ipc.ServerTransport.IServerState { [System.Obsolete("Constructors of types with required members are not supported in this version of " + "your compiler.", true)] - public WebSocketTransport() { } - public System.Uri Uri { get; init; } - public override UiPath.Ipc.IClientState CreateState() { } + public WebSocketServerTransport() { } + public System.Func> Accept { get; init; } + protected override UiPath.Ipc.ServerTransport.IServerState CreateServerState() { } public override string ToString() { } - public override void Validate() { } + protected override System.Collections.Generic.IEnumerable ValidateCore() { } } } \ No newline at end of file