Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StanConnectRequestTimeoutException leaves client in invalid state #73

Closed
ColinSullivan1 opened this issue Jul 27, 2018 · 0 comments
Closed

Comments

@ColinSullivan1
Copy link
Member

After StanConnectRequestTimeoutException is thrown client is in invalid state with resources hanging in the void. This prevents application from closing gracefully.

class Program
{
  static void Main(string[] args)
  {
    TestTimeout();
  }

  private static void TestTimeout()
  {
    var options = StanOptions.GetDefaultOptions();
    options.ConnectTimeout = 1;

    try
    {
    new StanConnectionFactory().CreateConnection("test-cluster", "test", options);
    }
    catch (StanConnectRequestTimeoutException)
    {
    Console.WriteLine("Timeout");
    }
  }
}

After executing this code application stays open. My machine runs Windows 10 64-bit with nats-streaming-server 0.10.2.

Originally filed as nats-io/nats.net.v1#225 by @mabzd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant