Skip to content

Commit

Permalink
Allow multiple connections per session
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham committed Sep 15, 2021
1 parent 63fa995 commit c31cf26
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,18 @@ listeners</dfn>, which is initially empty.
A [=remote end=] has a [=set=] of <dfn>WebSocket connections not associated with a
session</dfn>, which is initially empty.

A [=WebDriver BiDi session=] has a <dfn>WebSocket connection</dfn> which is a
network connection that follows the requirements of the [[!RFC6455|WebSocket
protocol]]. This is initially null.
A [=WebSocket connection=] is a network connection that follows the
requirements of the [[!RFC6455|WebSocket protocol]]

A [=WebDriver BiDi session=] has a set of <dfn>session WebSocket
connections</dfn> whose elements are [=WebSocket connections=]. This is
initially empty.

A [=WebDriver BiDi session=] |session| is [=associated with connection=]
|connection| if |session|'s [=session WebSocket connections=] contains |connection|.

Note: Each [=WebSocket connection=] is associated with at most one [=WebDriver
BiDi session=].

<div>

Expand Down Expand Up @@ -544,9 +553,9 @@ accept the incoming connection:
connection should be accepted, and if it is not stop running these
steps and act as if the requested service is not available.

1. Otherwise set |session|'s [=WebSocket connection=] to
|connection|, and proceed with the WebSocket [=server-side
requirements=] when a server chooses to accept an incoming connection.
1. Otherwise append |connection| to |session|'s [=session WebSocket
connections=], and proceed with the WebSocket [=server-side requirements=]
when a server chooses to accept an incoming connection.

Issue: Do we support > 1 connection for a single session?

Expand Down Expand Up @@ -661,10 +670,10 @@ To <dfn>handle an incoming message</dfn> given a [=WebSocket connection=]
Issue: Nothing seems to define what [=status codes|status code=]
is used for UTF-8 errors.

1. If there is a WebDriver [=/session=] with |connection| as its [=connection=],
let |session| be that session. Otherwise if |connection| is in the set of
[=WebSocket connections not associated with a session=], let |session| be
null. Otherwise, return.
1. If there is a [=WebDriver BiDi Session=] [=associated with connection=]
|connection|, let |session| be that session. Otherwise if |connection| is in
the set of [=WebSocket connections not associated with a session=], let
|session| be null. Otherwise, return.

1. Let |parsed| be the result of [=parse JSON into Infra values|parsing JSON
into Infra values=] given |data|. If this throws an exception, then [=respond
Expand Down Expand Up @@ -804,13 +813,17 @@ To <dfn>respond with an error</dfn> given a [=WebSocket connection=]
To <dfn>handle a connection closing</dfn> given a [=WebSocket connection=]
|connection|:

1. If there is a WebDriver [=/session=] with |connection| as its [=connection=],
set the [=connection=] on that [=/session=] to null.
1. If there is a [=WebDriver BiDi session=] [=associated with connection=]
|connection|:

1. If the set of [=WebSocket connections not associated with a session=]
contains |connection|, remove |connection| from that set.
1. Let |session| be the [=WebDriver BiDi session=] [=associated with
connection=] |connection|.

1. Remoce |connection| from |session|'s [=session WebSocket
connections=].

Issue: This should also reset any internal state
1. Otherwise, if the set of [=WebSocket connections not associated with a session=]
contains |connection|, remove |connection| from that set.

</div>

Expand Down

0 comments on commit c31cf26

Please sign in to comment.