none
Problems with finding UDPbinding RRS feed

  • Question

  • I am migrating a code from Framework 4.6 to universal app code to consume a WCF Service. When configuring my binding for consuming an UDPbinding from WCF in 4.6 framework I cannot find UDPbinding in System.ServiceModel anymore in .NET for Universal Apps. I need a communication as fast as possible and .nettcpbinding seems not enough. I have added as reference System.ServiceModel and System.ServiceModel.Channels Any idea? This is my code from the client in .NETCORE for Universal for configuring the connection to WCF Service:

    try
        {
    
         //THE FOLLOWING LINE IS NOT RECOGNISED
         UdpBinding UDPBinding= new UdpBinding();
         EndpointAddress addr = new EndpointAddress("soap.udp://" + ipAddress + ":" + portNo);
         ChannelFactory<IService1> chn = new ChannelFactory<IService1>(UDPBinding, addr);
         IService1 communication= chn.CreateChannel();
         return communication;
        }
        catch (Exception ex)
        {
        
        }

    This is my code in the server side ( .NET 4.6.1 framework)

    private void ConService(string PortNumb) {
    
            host = new ServiceHost(typeof(NewWCF), new Uri("http://localhost:/XXX/XXX"));
            // Add service endpoint
            UdpBinding UDPBinding = new UdpBinding();
            string address = "soap.udp://localhost:" + portNo;
            host.AddServiceEndpoint(typeof(IService1), UDPBinding , address);
           host.Open();} 
        }

    Friday, April 22, 2016 7:18 PM

All replies