void OnDiscoverMEX(object sender, EventArgs e) { IMyContract proxy = CreateChannel <IMyContract>(); proxy.MyMethod(); (proxy as ICommunicationObject).Close(); }
void OnCallService(object sender, EventArgs e) { EndpointAddress address = m_AnnouncementSink[0]; IMyContract proxy = ChannelFactory <IMyContract> .CreateChannel(new NetTcpBinding(), address); proxy.MyMethod(); (proxy as ICommunicationObject).Close(); }
void OnDiscoverAddress(object sender, EventArgs e) { EndpointAddress address = DiscoverAddress <IMyContract>(); Binding binding = new NetTcpBinding(); IMyContract proxy = ChannelFactory <IMyContract> .CreateChannel(binding, address); proxy.MyMethod(); (proxy as ICommunicationObject).Close(); }