开发者

Monotouch WCF call crashes with SIGILL error on 10th attempt

Using latest monotouch(4.0.3) we have WCF services that are called. After performing the call the 10th attempt crashes. I have created a test program that calls simple WCF call to see if service is up. Responds with an OK message. On 10th call it fails. Tried Server config settings, Close, Dispose on client still same results. Sample Test code segment below:

    public override void ViewDidLoad ()
    {
        base.ViewDidLoad ();


        mailButton.TouchUpInside += (o, e) =>
        {

        BasicHttpBinding BindType = new BasicHttpBinding();
        BindType.ReceiveTimeout = new TimeSpan(0,0,15);

        EndpointAddress ep = new EndpointAddress(@"http://myservice.mydomain.com/MyBusServiceBusService/MFService.svc/BaseService");
        BaseServiceClient MFService = new BaseServiceClient(BindType, ep);
        MFService.Endpoint.Binding.ReceiveTimeout = new TimeSpan(0,0,10);
        MFService.BaseServiceTestCompleted += delegate(object sender, BaseServiceTestCompletedEventArgs ex) 
          {
              UIAlertView alert = new UIAlertView();
              alert.Title = "Base Service Test";
              alert.AddButton("Ok");
              ++timesThrough;
              alert.Message = ex.Result + " Times=" + timesThrough.ToString();;
              alert.InvokeOnMainThread(delegate{alert.Show();  });
              var clientObject = sender as BaseServiceClient;
                if (clientObject != null && clientObject.State == System.ServiceModel.CommunicationState.Opened)
                {
                       (clientObject.ChannelFactory).Close();
                     (clientObject).Close();
                      ((IDisposable)clientObject).Dispose();
                     clientObject = null;
                }
              if (MFService != null)
                 {

                    (MFService.ChannelFactory).Close();
                     (MFService).Close();
                      ((IDisposable)MFService).Dispose();
                     MFService = null;
                 }

             GC.Collect();



        };

        try
        {
          MFService.BaseServiceTestAsync();

        }
        catch (Exception ex)
        {
          UIAlertView alert = new UIAlertView();
          alert.Title = "Base Service Test";
          alert.AddButton("Ok");

  开发者_运维百科        alert.Message = ex.Message ;
          alert.InvokeOnMainThread(delegate{alert.Show();});
          MFService = null;
          GC.Collect();
        }



        };
    }


This issue was fixed in the latest MonoTouch (4.1 beta). The 4.2 (stable) release should be available soon.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜