コード例 #1
0
        public WcfScServiceHost()
        {
            //    this._settingsToSerialize = settings;

            Trace.TraceInformation("Service hosting...");
            Trace.Indent();

            var baseAddress = new UriBuilder("net.tcp", System.Net.Dns.GetHostName(), 13640, "wcf");

            _serviceHost = new ServiceHost(typeof(ServiceClient));
            NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);

            binding.ReceiveTimeout = new TimeSpan(2, 0, 0, 0);
            binding.ReliableSession.InactivityTimeout = new TimeSpan(2, 0, 0, 0);
            binding.ReliableSession.Enabled           = true;
            binding.ReliableSession.Ordered           = false;
            _serviceHost.AddServiceEndpoint(typeof(IHostingClientService), binding, baseAddress.Uri + "/client");
            _serviceHost.AddServiceEndpoint(typeof(IControllerService), binding, baseAddress.Uri + "/controller");

            _serviceHost.Description.Behaviors.Add(new ServiceDiscoveryBehavior());
            _serviceHost.AddServiceEndpoint(new UdpDiscoveryEndpoint());

            _serviceHost.Open();

            Client = new WcfScServiceClient(baseAddress.Uri + "/client", binding);

            Trace.Unindent();
            Trace.TraceInformation("... Done");
        }
コード例 #2
0
 public ClientCallback(WcfScServiceClient parent)
 {
     this._parent = parent;
 }