Skip to content

Fix buffer and async event arg handle leaks - #5

Merged
barnstee merged 1 commit into
OPCFoundation:masterfrom
marcschier:buffer_leak_fixes
May 10, 2016
Merged

Fix buffer and async event arg handle leaks#5
barnstee merged 1 commit into
OPCFoundation:masterfrom
marcschier:buffer_leak_fixes

Conversation

@marcschier

Copy link
Copy Markdown
Collaborator

Buffers were not released and caused oom after a while. Also, SocketAsyncEventArgs must be disposed as they contain socket file handles.

@CLAassistant

CLAassistant commented May 9, 2016

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@barnstee
barnstee merged commit 18bb13f into OPCFoundation:master May 10, 2016
barnstee pushed a commit that referenced this pull request Sep 5, 2016
A few fixes to get GDS apps starting.
marcschier added a commit that referenced this pull request May 4, 2026
…e CertificateManager (S12)

RegisterWithDiscoveryServerAsync previously constructed a fresh
CertificateValidator and called UpdateAsync separately. Per the
final-plan decision (#5), the registration channel now shares the
server's CertificateManager (and the configuration's existing
CertificateValidator handle for legacy property compatibility) so
that trust-list state, rejected-store entries, and cached validation
decisions stay consistent between the server's listening endpoints
and its outbound discovery channel.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
marcschier added a commit that referenced this pull request Jun 2, 2026
Address 7 of the 16 unresolved review comments from round 3:

- #6 Tools/Opc.Ua.SourceGeneration/ModelCompilation.cs:300 - add
  `using System.Collections.Generic` and
  `using Opc.Ua.SourceGeneration.Dependency` so the file no longer
  spells fully-qualified type names inline. Same sweep for the
  `System.Collections.Generic.`/`Opc.Ua.SourceGeneration.Dependency.`
  prefixes at other call sites in the file.
- #7 Tools/Opc.Ua.SourceGeneration.Core/Generators.cs:634 (and 3 other
  sites in FluentBuilderGenerator + GeneratorOptions + ModelCompilationOptions)
  - drop `FB-3 phase 3` / phase / track references from comments and
  xmldoc; describe the feature, not the rollout.
- #9 Libraries/Opc.Ua.Di.Client/Hosting/OpcUaClientDiBuilderExtensions.cs:69
  - re-wrap the long `<item><description>...</description></item>` doc
  list to fit inside the 140-char editorconfig limit.
- #12 Strip `global::` qualification from all hand-written PR code
  (Libraries/Opc.Ua.Di.*, Applications/PumpDeviceIntegrationServer).
  Only kept where required to disambiguate (test-side `Pumps.PumpNodeManager`
  / `Pumps.PumpNodeManagerFactory` collide with the source-generated
  `Opc.Ua.Pumps` namespace; restored `global::` on those refs).
  Hand-written code now matches the .editorconfig convention of letting
  `using` directives carry the namespace burden; source-generated code
  still uses `global::` (unchanged).
- #15 Remove `// -----` / `// =====` ASCII-banner `#region`-style
  comments from SoftwareUpdateClient.StateMachine.cs,
  SoftwareUpdateClient.Upload.cs, SoftwareUpdateFacetWiring.cs and
  SoftwareUpdateFileTransferManager.cs. Inline section comments
  remain unchanged.
- #16 Expand 344 one-line `/// <summary>text</summary>` declarations
  across 72 files in Applications/, Libraries/, Stack/, Tests/ and
  Tools/ into the three-line
  `/// <summary>\n/// text\n/// </summary>` form.
- Carry-over from FB-3 phase 3: while sweeping `global::` also
  un-qualify the hand-written Pumps server callsites
  (Pump #1 wiring in PumpNodeManager.cs / PumpNodeManager.Configure.cs)
  so the new code matches the reviewer's convention.

Validation:
- `dotnet build UA.slnx` — clean (0 errors, 15 unrelated warnings
  reported transiently by the build engine).
- `Opc.Ua.SourceGeneration.Core.Tests` — 3535 passed / 8 skipped.
- `Opc.Ua.Di.Tests` (Pump + DI client + SoftwareUpdate filter) —
  85/85 passed.

The remaining 9 round-3 items (architecture relocation #8,
`=>`→`{}` body sweep #10, ObjectType-proxy refactor #11/#14,
brace-formatting sweep #13, pump server Configure refactor #1/#2,
DeviceHealth + functional-group exposure #3/#5 plus DI doc
disambiguation #4) are tracked separately and will land in
subsequent commits.
marcschier added a commit that referenced this pull request Jun 5, 2026
- Move all channel-related types into `Stack/Opc.Ua.Core/Stack/Client/Channels/`
  subfolder (#13).
- Un-obsolete `SessionReconnectHandler` and the SessionExtensions
  `ReconnectAsync(connection, ct)` / `(channel, ct)` extensions; remove
  all SRH-related `#pragma warning disable CS0618` suppressions from
  applications and tests. AttachChannel/DetachChannel remain obsolete (#1, #4).
- Remove the shared-budget section from MigrationGuide.md (#3).
- Mark `ManagedSession.AttachChannel`/`DetachChannel` `[Obsolete]` so the
  warning surfaces all the way up the supported API surface (#9).
- Break the `<see cref=…>` line in `Session.ChannelManager.cs` to stay under
  140 chars (#10).
- Move `ChannelManagerSessionFactory` from `Opc.Ua.Gds.Client.Common` into
  `Opc.Ua.Client` as a public, documented session-factory option (#11).
- Audit other client classes for `IClientChannelManager`-aware overloads;
  add `ISessionFactory`-accepting overloads on `GlobalDiscoveryServerClient`,
  `LocalDiscoveryServerClient`, `ServerPushConfigurationClient` so any
  session factory (including `ChannelManagerSessionFactory`) works (#12).
- Refactor MCP server (`OpcUaSessionManager`, `Program`) to use
  `ManagedSession` + DI-resolved `IClientChannelManager`; remove
  `SessionReconnectHandler` and manual keep-alive reconnect (#2).
- ConnectionStateMachine code-style fixes: use named delegate types,
  collapse multi-line callback properties to single lines, swap
  `timeProvider`/`maxTotalReconnectTime` constructor param order,
  fix multi-line declaration (#6, #7, #8).
- HTTPS resilience: confirmed `Microsoft.Extensions.Http` and
  `Microsoft.Extensions.Http.Resilience` 10.6.0 support
  `net472`/`net48`/`netstandard2.1`; removed `#if NET8_0_OR_GREATER`
  gating from `ManagedSessionBuilder` and `OpcUaClientBuilderExtensions`
  and HTTPS csproj package refs (#5).

Verification:
- `Opc.Ua.Client` + `Opc.Ua.Core` + `Opc.Ua.Gds.Client.Common` build
  clean (0 warnings, 0 errors).
- 56/56 core channel-manager / retry-budget / HTTPS factory tests pass.
- 129/129 client (ManagedSession + legacy SRH back-compat + SessionExtensions)
  tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants