• Nick Craver's avatar
    This is a relatively minor pass at simplifying the connect logic. · bbad0492
    Nick Craver authored
    This was an expedition, but here's the history:
    - There are 2 forks in the connection logic
     - One for Mono (the DnsEndpoint split, see #20 and #155)
     - One for .BeginConnect() and one for ConnectAsync (because netstandard1.x was "async all the things!")
    - There's a behind-the-scenes fork on completion type, but for actual library consumers (and not tests), it was always .Any, which was effectively .Sync.
    
    There was also a critical bug fix in #113 that unfortuantely added a lot of complexity here. The maintenance problem is this complexity wasn't even used, as far as I can tell. It was only ever exposed to even be possibly used in the test project. So we had complicated connection logic, only for the sake of testing it. Unless I'm an idiot, which is entirely possible.
    
    This commit removes that logic and simplifies things, as a first step that's a unit in itself. It does not fix Mono. There are other issues there, but thanks to WSL I can readily run the test suite under Mono on Linux now. Mono has a littany of other issues which I'll comment on in #314.
    
    The most important thing here is that we don't regress what was fixed in #113, as this doesn't readily show in tests.
    bbad0492
ConnectingFailDetection.cs 4.45 KB