Stack-overflow Exception in Servicehost object

Asked

Viewed 33 times

1

I have a simple implementation of webservice. After years of software in use, began to burst exception on the object Servicehost.

try
            {
                using (this._host = new ServiceHost(_receiver, new Uri("net.tcp://localhost:8000")))
                {

                    this._host.OpenTimeout = TimeSpan.FromMinutes(5);
                    this._host.CloseTimeout = TimeSpan.FromMinutes(5);

                    var binding = new NetTcpBinding
                    {
                        CloseTimeout = TimeSpan.FromMinutes(5),
                        OpenTimeout = TimeSpan.FromMinutes(5),
                        SendTimeout = TimeSpan.FromMinutes(15),
                        ReceiveTimeout = TimeSpan.FromMinutes(15),

                        MaxReceivedMessageSize = 2147483647,
                        MaxBufferPoolSize = 2147483647,
                        MaxBufferSize = 2147483647
                    };

                    //notice the NetTcpBinding?  This allows programs instead of web stuff
                    // to communicate with each other
                    this._host.AddServiceEndpoint(typeof(IMessageReceiver), binding, "ISubscribe");


                    this._host.Opened += host_Opened;
                    this._host.Closed += host_Closed;
                    this._host.Faulted += host_Faulted;
                    this._host.Open();

                    this.LogMessage("Canal Aberto");
                    string tmp = Console.ReadLine();
                    while (tmp != "EXIT")
                    {
                        tmp = Console.ReadLine();
                    }

                    Console.ReadLine();
                    this._host.Close();

                }

            }
            catch (Exception ex)
            {
                this.LogMessage(ex.ToString());
            }
        }

Usually this type of exception occurs in recursion, or poorly implemented code, but the exception points to the line where the using. This may be some problem in the configuration of Webservice?

System.StackOverflowException   
HResult=0x800703E9  
Message=Exception_WasThrown

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.