开发者

Socket/Timeout in Azure WebRole for synchronous communication with WCF Host in WorkerRole

I'm trying to get this to work on an internal tcp connection. The code runs flawlessly in development but when deployed to Azure I get ...

a CommunicationException "The socket connection was aborted" trying to connect to "net.tcp://......" with a time code about 60 seconds it waited.

wcf host side:

_WCFHost.AddServiceEndpoint(typeof(IServiceWCFContract), new NetTcpBinding(),_ServiceUrl);
_WCFHost.Open();

wcf client side:

var channelfactory = new ChannelFactory<IServiceWCFContract>(new NetTcpBinding(), service.Url);            
channelfactory.Open(new TimeSpan(0,0,20)); //20 sec timeout
var resp = channel.GetValues();

I'm sure I'm grabbing the correct url from the RoleEnvironment.Roles["WcfWorkerRole"].开发者_C百科Instances

I've made sure enableNativeCodeExecution = "true" is set in the .csdef in both roles.

Ive tried basic http binding too, but azure doesn't like the worker roles having http: names spaces.


on the forum of windows azure there are a lot of posts suggesting that a tcp binding is currently not supported. I would try changing the endpoint to wsHttp and checking if that works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜