Monotouch/WCF: why cannot override the wcf binding timeout setting

Monotouch/WCF: why cannot override the wcf binding default timeout setting:

public class MyServiceClient : ClientBase<IMyContract>,IMyContract
{ ... }

public void test() {
        BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
        basicHttpBinding.Name = "basicHttpBinding";
        basicHttpBinding.MaxBufferSize = int.MaxValue;
        basicHttpBinding.MaxReceivedMessageSize = int.MaxValue;
        basicHttpBinding.ReceiveTimeout = TimeSpan.FromSeconds(10.0);
        basicHttpBinding.SendTimeout = TimeSpan.FromSeconds(10.0);
        basicHttpBinding.CloseTimeout = TimeSpan.FromSeconds(5.0);
        basicHttpBinding.OpenTimeout = TimeSpan.FromSeconds(5.0);

       MyServiceClient client = New MyServiceClient(basicHttpBinding, new EndPointAddress(...));
       client.Test();
     }

// Althought I set the OpenTimeout to 5 seconds, but when I close the server service(or close the iphone's wifi & network), it still try to connect to the service in the background until the default 1 miniute timeout, it's strange! Why? thanks.

btw, the exception in monotouch/iPhone throw after 1 minutes,the type is TimeoutException(message:The operation has timed-out.) not the FaultException or CommunicationException). If the above code invoke in windows .net client, it should be throw the CommunicationException.

Answers


xamarin team reply: serviceClient.innerchannel.operationtimeout = ... thanks.


Need Your Help

why the values of properties in the prototype are inconsistent?

javascript prototype

I called console.log(Family.prototype.money) and value is 200, which confirms that asset is the prototype of the function Family. But when I called console.log(other.money), the value is 1000, whic...

Debugging Invoked function in .NET

.net visual-studio debugging reflection invoke

I call function in .NET using Reflection (Method.Invoke). If an error occurs inside this method and exception is raised, debugger doesn't show actual code but stops at Invoke() call. I can retrieve

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.