Ejemplo n.º 1
0
        private void NetTcpCallback(ConnectionState state, HelloWorldWcfServiceClientBase service)
        {
            _netTcpState   = state;
            _netTcpService = service;

            if (state == ConnectionState.Success && service is HelloWorldWcfServiceClient client)
            {
                client.HelloCallbackReceived += (sender, args) =>
                {
                    _receivedMessage = args.message;
                    NetTcpCallbackReceived.Set();
                };
                client.ThrowCallbackReceived += (sender, args) =>
                {
                    NetTcpThrowCallbackReceived.Set();

                    // The exception here is on purpose!
                    throw new NotImplementedException();
                };
            }
        }
Ejemplo n.º 2
0
        private void Clear(bool full)
        {
            lock (_receivedClientInfos)
            {
                _receivedClientInfos.Clear();
            }

            _netTcpConnectedEvent.Reset();
            _basicHttpConnectedEvent.Reset();
            _netTcpDisconnectedEvent.Reset();
            _basicHttpDisconnectedEvent.Reset();
            _clientInfoChangedEvent.Reset();
            NetTcpCallbackReceived.Reset();
            NetTcpThrowCallbackReceived.Reset();

            if (full)
            {
                _basicHttpService = null;
                _netTcpService    = null;
            }
        }
Ejemplo n.º 3
0
 public HelloWorldWcfServiceClientBase(System.ServiceModel.InstanceContext callbackInstance, EndpointConfiguration endpointConfiguration) :
     base(callbackInstance, HelloWorldWcfServiceClientBase.GetBindingForEndpoint(endpointConfiguration), HelloWorldWcfServiceClientBase.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Ejemplo n.º 4
0
 public HelloWorldWcfServiceClientBase(System.ServiceModel.InstanceContext callbackInstance) :
     base(callbackInstance, HelloWorldWcfServiceClientBase.GetDefaultBinding(), HelloWorldWcfServiceClientBase.GetDefaultEndpointAddress())
 {
     this.Endpoint.Name = EndpointConfiguration.NetTcpBinding_IHelloWorldWcfService.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Ejemplo n.º 5
0
 private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
 {
     return(HelloWorldWcfServiceClientBase.GetEndpointAddress(EndpointConfiguration.NetTcpBinding_IHelloWorldWcfService));
 }
Ejemplo n.º 6
0
 private static System.ServiceModel.Channels.Binding GetDefaultBinding()
 {
     return(HelloWorldWcfServiceClientBase.GetBindingForEndpoint(EndpointConfiguration.NetTcpBinding_IHelloWorldWcfService));
 }