コード例 #1
0
 public void Destroy()
 {
     manual_close = true;
     cf.Close();
     cf  = null;
     srv = null;
 }
コード例 #2
0
 private void Cf_Closed(object sender, EventArgs e)
 {
     if (!manual_close)
     {
         srv = cf.CreateChannel();
     }
 }
コード例 #3
0
        public void Create(Action <long> handle, string host, string port)
        {
            EndpointAddress end     = new EndpointAddress("net.tcp://" + host + ":" + port + "/XPressionService");
            NetTcpBinding   tcp     = new NetTcpBinding();
            CallbackHandler handler = new CallbackHandler(handle);
            ServiceEndpoint svend   = new ServiceEndpoint(new ContractDescription("XPressionService", "XPressionService.IXPressionWCF"), tcp, end);

            cf           = new DuplexChannelFactory <IXPressionWCF>(handler, tcp, end);
            srv          = cf.CreateChannel();
            manual_close = false;
            cf.Closed   += Cf_Closed;
            cf.Faulted  += Cf_Faulted;
        }
コード例 #4
0
 public void Reconnect()
 {
     srv = cf.CreateChannel();
 }
コード例 #5
0
 private void Cf_Faulted(object sender, EventArgs e)
 {
     srv = cf.CreateChannel();
 }