Exemple #1
0
    void OnDiscoverMEX(object sender, EventArgs e)
    {
        IMyContract proxy = CreateChannel <IMyContract>();

        proxy.MyMethod();

        (proxy as ICommunicationObject).Close();
    }
Exemple #2
0
    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();
    }
Exemple #3
0
    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();
    }