Reputation: 117
I am migrating an "old" code from Framework 4.6 to universal app code to consume a WCF Service.I have different bindings, NetTCPbinding is working ok, 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
{
//Here I cannot find the UDPbinding!!!!!
UdpBinding myBinding = new UdpBinding();
EndpointAddress addr = new EndpointAddress("soap.udp://" + ipAddress + ":" + portNo);
ChannelFactory<IService1> chn = new ChannelFactory<IService1>(myBinding, addr);
IService1 conn = chn.CreateChannel();
return conn;
}
catch (Exception ex)
{
return null;
}
My server service configuration routine is this:
private void ConfigService(string portNo) {
host = new ServiceHost(typeof(WCFComm), new Uri("http://localhost:/XXX/XXX"));
// Add service endpoint
UdpBinding myBinding = new UdpBinding();
string address = "soap.udp://localhost:" + portNo;
host.AddServiceEndpoint(typeof(IService1), myBinding, address);
try {host.Open();} catch(Exception ex) {}
}
Thanks,
Upvotes: 0
Views: 124