簡體   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