net.tcp port sharing and mono

倖福魔咒の 提交于 2019-12-11 18:11:58

问题


in my self-hosted WCF application I've got a problem using port sharing with mono. Given the following code, this exception is thrown:

System.Net.Sockets.SocketException: Address already in use

and here is my code:

NetTcpBinding tcpBinding = new NetTcpBinding();
ServiceHost host1 = new ServiceHost(myService1);
host1.AddServiceEndpoint(typeof(IMyService1Contract), tcpBinding, "net.tcp://192.168.0.70:8075/service1");
host1.Open();

ServiceHost host2 = new ServiceHost(myService2);
host2.AddServiceEndpoint(typeof(IMyService2Contract), tcpBinding, "net.tcp://192.168.0.70:8075/service2");
host2.Open();

I already found this bug report here https://bugzilla.xamarin.com/show_bug.cgi?id=277. Unfortunately there was never a response to the last comment.

Like the person who wrote the report, my code works perfectly fine with windows/.net, but on my linux machine using mono 2.10.8.1 (raspberry pi, soft-float Debian) the mentioned exception occurs.

Thank you very much in advance for your answer!

来源:https://stackoverflow.com/questions/15948639/net-tcp-port-sharing-and-mono

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!