protected override Task <FabricTransportServiceRemotingClient> CreateClientAsync( string endpoint, CancellationToken cancellationToken) { try { var remotingHandler = new FabricTransportRemotingClientConnectionHandler(); var nativeClient = new FabricTransportClient(this.settings.GetInternalSettings(), endpoint, remotingHandler, this.fabricTransportRemotingCallbackMessageHandler); var client = new FabricTransportServiceRemotingClient(nativeClient, remotingHandler); remotingHandler.ClientConnected += this.OnFabricTransportClientConnected; remotingHandler.ClientDisconnected += this.OnFabricTransportClientDisconnected; return(Task.FromResult(client)); } catch (FabricInvalidAddressException) { throw new FabricInvalidAddressException( string.Format( CultureInfo.CurrentCulture, SR.ErrorInvalidAddress, endpoint )); } }
public FabricTransportServiceRemotingClient( FabricTransportClient nativeClient, FabricTransportRemotingClientConnectionHandler remotingClientConnectionHandler) { this.settings = nativeClient.Settings; this.ConnectionAddress = nativeClient.ConnectionAddress; this.IsValid = true; this.nativeClient = nativeClient; this.RemotingClientConnectionHandler = remotingClientConnectionHandler; }