Skip to content

Socket, connection handling changes#227

Merged
gbakeman merged 2 commits intodev-2.3from
223-lost-con
Nov 17, 2025
Merged

Socket, connection handling changes#227
gbakeman merged 2 commits intodev-2.3from
223-lost-con

Conversation

@gbakeman
Copy link
Contributor

@gbakeman gbakeman commented Nov 16, 2025

Attempting to troubleshoot lost connection problem in #223. This led to some significant changes in the socket communication code.

Enums: Removed noresponse enum, replaced with empty and unrecognized.

Socket:

  • Modified Disconnect sub to have more concise parameter, remove unnecessary stream disposal
  • Restructuring of core Query_Data subroutine. Moved or eliminated variable initialization, early sanity check for connection status, removed redundant newline in stream write, process response using .NET functions, move Enum parsing inline to subroutine, early check for null/empty response, distinct handling of good vs. bad results
  • Removed unused Watchdog code (essentially became null/empty case in Query subroutine)
  • Removed exception from Socket_Broken parameter

UPS:

  • Stop variable update loop from calling Socket_Broken() (prevents duplicate triggers, the other being in Socket)
  • In multi-variable get subroutine, only recurse on VARNOTSUPPORTED or STALE errors, everything else should be thrown.

Also includes a small bugfix that makes the connection menu command buttons sync their state when the connection is lost.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not detecting lost connection in certain circumstances

2 participants