コード例 #1
0
 public FabricTransportClient(
     FabricTransportSettings transportSettings,
     string connectionAddress,
     IFabricTransportClientConnectionHandler eventHandler,
     IFabricTransportCallbackMessageHandler contract = null)
 {
     this.ConnectionAddress = connectionAddress;
     this.settings          = transportSettings;
     Utility.WrapNativeSyncInvokeInMTA(
         () => this.CreateNativeClient(transportSettings, connectionAddress, eventHandler, contract),
         "FabricTransportClient.Create");
 }
コード例 #2
0
        private void CreateNativeClient(
            FabricTransportSettings transportSettings,
            string connectionAddress,
            IFabricTransportClientConnectionHandler eventHandler,
            IFabricTransportCallbackMessageHandler contract)
        {
            var iid = typeof(NativeServiceCommunication.IFabricServiceCommunicationClient2).GetTypeInfo().GUID;

            using (var pin = new PinCollection())
            {
                var nativeTransportSettings = transportSettings.ToNative(pin);
                var messageHandler          = new FabricTransportCallbackHandlerBroker(contract);
                var nativeConnectionAddress = pin.AddBlittable(connectionAddress);
                var nativeEventHandler      = new FabricTransportNativeClientConnectionEventHandler(eventHandler);
                this.nativeClient =
                    (NativeServiceCommunication.IFabricServiceCommunicationClient2)
                    NativeServiceCommunication.CreateServiceCommunicationClient(
                        ref iid,
                        nativeTransportSettings,
                        nativeConnectionAddress,
                        messageHandler,
                        nativeEventHandler);
            }
        }
 public FabricTransportNativeClientConnectionEventHandler(IFabricTransportClientConnectionHandler clientConnectionHandler)
 {
     this.clientConnectionHandler = clientConnectionHandler;
 }