1) Does Mystic pass a blocking or non-blocking socket handle?
Blocking
2) With regard to point 1, is there an established standard which all BBS systems adhere to (i.e. blocking or non-blocking)?
The only standard that I know of that ever attempted to define anything was Mystic's DOOR32 and that uses blocking sockets. I assume you'd probably get blocking from most BBSes then by default, but I can't say for sure what other software does.
3) If the door changes socket mode, should this be undone prior to exit?
I think it'd be a good practice to do this.
The original intention was that the socket should be duplicated before being passed to the door, but I think in practice that didn't end up being guarenteed or even done at all because of variations in operating systems (and if I am not mistaken some OSes specifically said that sockets should not be duplicated).
I didn't have the foresight back in the 1990s to specifically call this stuff out in the DOOR32 docs unfortunately and now I forget most of the details like this. It was all pretty new back then and I was inexperienced.
4) Is the door expected to perform winsock clean-up if the client
performs an impromptu disconnect?
It *might* be safe to call only when it drops but I can't say for sure without experimentation.
If I remember correctly calling WSACleanup is a Windows specific thing and it invalidates any socket handles used by the process. For that reason I think it was not called in any case within D32 doors. Instead it let the BBS detect the connection loss and do what it does.
Things may behave differently depending of if/when the socket was duplicated by the BBS before being passed, but I would
operate on the assumption that the socket is not duplicated.
--- Mystic BBS v1.12 A47 2021/06/07 (Windows/32)
* Origin: Sector 7 | Mystic WHQ (1:129/215)