简体   繁体   English

OSX上的单声道WCF问题

[英]Mono WCF issue on OSX

I've written a mono compatible application that works fine on a Windows machine and mostly works on my mac. 我编写了一个单声道兼容的应用程序,可以在Windows机器上正常工作,并且主要在我的Mac上运行。 The area that currently doesn't work is the layer that uses the WCF (ChannelFactory) to communicate between server and client. 当前不起作用的区域是使用WCF(ChannelFactory)在服务器和客户端之间进行通信的层。

The issue appears to be when I try and open the ChannelFactory on the Server, here is a code snippet: 问题似乎是当我尝试在服务器上打开ChannelFactory时,这是一个代码片段:

string address = "21"; // added this for simplicity in conveying the problem...
string server_address = "net.tcp://192.168.1.122:4505/DeviceServer/";
string serviceAddress = string.Format(server_address, address);

ThreadedServiceHost<DeviceService, IDeviceContract> DeviceHost =
            new ThreadedServiceHost<DeviceService, IDeviceContract>(serviceAddress, address, new NetTcpBinding());

EndpointAddress endPoint = new EndpointAddress(
                     new Uri(string.Format(serviceaddress, address) + address));

System.ServiceModel.Channels.Binding binding = new NetTcpBinding();

teeGlobal.ServerDeviceFactory = new ChannelFactory<IDeviceChannel>(binding, endPoint);
teeGlobal.ServerDeviceFactory.Open();

The issue is with the .Open() call - it just appears to hang on my mac. 问题出在.Open()调用 - 它似乎挂在我的mac上。 Creating the endpoint takes a lot longer to create than on my PC (about 3-4 seconds) but I can live with this if I can get the WCF layer to function. 创建端点比在我的PC上创建需要更长的时间(大约3-4秒),但如果我可以让WCF层运行,我可以忍受这个。

Does anyone have any suggestions on how to progress with this issue? 有没有人对如何推进这个问题有任何建议?

The most recent stable release of Mono is 2.8.2 (http://www.go-mono.com/mono-downloads/download.html) Mono的最新稳定版本是2.8.2(http://www.go-mono.com/mono-downloads/download.html)

You really need to try with this version before doing anything else. 在做其他任何事情之前,你真的需要尝试使用这个版本。 The WCF stack in 2.6.x was more of a 'preview' than anything else, and only some common scenarios actually worked. 2.6.x中的WCF堆栈比其他任何东西都更像是“预览”,只有一些常见的场景才有效。 2.8 is much more complete. 2.8更加完整。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM