AdaCore / AdaCore/aws

WebSocket: On_Close called when user explicitly closes a web socket via AWS.Net.WebSocket.Registry.Close

Open
#371 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ada
Stars
162
Forks
45
PR merge metrics
No merged PRs in 30d

Description

Description
In AWS.Net.WebSocket.Close implementation, it is documented that

      --  When the user explicitly closes a web socket, we do not call
      --  On_Close (this is only called when the other end closes the socket)

However, when the user explicitly closes a web socket via AWS.Net.WebSocket.Registry.Close, On_Close is called

Patch
aws-net-websocket-registry.adb.patch.txt

Different behavior in AWS.Net.WebSocket.Registry.Close implementations
On another note, calling AWS.Net.WebSocket.Registry.Close(Socket : in out Object'Class; internally calls Socket.Shutdown while calling AWS.Net.WebSocket.Registry.Close(To : Recipient; does not. Any rational on why having different behaviour ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documented AWS.Net.WebSocket.Close behavior, then inspect the two AWS.Net.WebSocket.Registry.Close entry points: the Object'Class overload and the Recipient overload. Compare their handling of On_Close and Socket.Shutdown with the attached aws-net-websocket-registry.adb.patch.txt; done means explicit closure no longer invokes On_Close and the differing Shutdown behavior is resolved or clearly justified.

Written by the indexing model from the issue text.

Assessment

Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.