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

EF Code First Object Context Cant find Stored Procedure at ExecuteFunction

mysql entity-framework stored-procedures ef-code-first

I am using EF 4.3 Code first with MySQL database. I am having problem executing stored procedure on the server. The code looks like as follows: