0

I am building a messaging application using NATS C# API. I have set all event handlers, but I have a problem in DisconnectedEventHandler. In the Github page, they have shown how to handle the event. I did exactly the same but whenever DisconnectedEventHandler is triggered, args.Conn.ConnectedUrl shows nothing. I just want to know which server is disconnected. Can anybody please help me on this?

Thanks in advance.

Cheers J

DJo
  • 2,133
  • 4
  • 30
  • 46
DrXSsive
  • 133
  • 1
  • 14

1 Answers1

0

If you are disconnected, but definition you are not connected to any server, so it makes sense that ConnectedUrl() returns nothing. You could save the URL you are connected to on success and then use that when getting disconnected.

I. Kozlovic
  • 796
  • 3
  • 3