Closed Linorman closed 1 year ago
You don't seem to be waiting for connect to complete, your connect(); in the constructor should be awaited not async void. However don't do this in a constructor, make your connect a separate method call it from main and await it, only proceed when you know you are connected.
Ok, thanks, it worked.
These are my codes.
In the main method I did this:
And the log goes:
Then it came the exception:
It did not connect successfully to the server but I did not know why it happened.