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

        proxy.MyMethod();

        (proxy as ICommunicationObject).Close();
    }
コード例 #2
0
ファイル: DiscoveryForm.cs プロジェクト: II01/i2MFCSv2.TAI
    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();
    }
コード例 #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();
    }