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 22, 2021
1 parent ed0e4c8 commit 495cce0
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,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 <dfn>WebSocket connection</dfn> is a network connection that follows the
requirements of the [[!RFC6455|WebSocket protocol]]

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

A [=BiDi session=] |session| is <dfn>associated with connection</dfn>
|connection| if |session|'s [=session WebSocket connections=] contains |connection|.

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

<div>

Expand Down Expand Up @@ -555,9 +564,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 @@ -672,7 +681,7 @@ 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=],
1. If there is a [=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.
Expand Down Expand Up @@ -815,13 +824,16 @@ 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 [=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 [=BiDi session=] [=associated with connection=]
|connection|.

1. Remove |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 495cce0

Please sign in to comment.