繁体   English   中英

OSX上的单声道WCF问题

[英]Mono WCF issue on OSX

我编写了一个单声道兼容的应用程序,可以在Windows机器上正常工作,并且主要在我的Mac上运行。 当前不起作用的区域是使用WCF(ChannelFactory)在服务器和客户端之间进行通信的层。

问题似乎是当我尝试在服务器上打开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();

问题出在.Open()调用 - 它似乎挂在我的mac上。 创建端点比在我的PC上创建需要更长的时间(大约3-4秒),但如果我可以让WCF层运行,我可以忍受这个。

有没有人对如何推进这个问题有任何建议?

Mono的最新稳定版本是2.8.2(http://www.go-mono.com/mono-downloads/download.html)

在做其他任何事情之前,你真的需要尝试使用这个版本。 2.6.x中的WCF堆栈比其他任何东西都更像是“预览”,只有一些常见的场景才有效。 2.8更加完整。

暂无
暂无

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

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