You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.bs
+31-2Lines changed: 31 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -89,12 +89,18 @@ A basic example of using connect with an echo server.
89
89
The {{Socket}} class is an instance of the [=socket=] concept. It should not be instantiated directly (`new Socket()`), but instead created by calling {{connect()}}. A constructor for {{Socket}} is intentionally not specified, and is left to implementors to create.
90
90
91
91
<pre class="idl">
92
+
[Exposed=*]
93
+
dictionary SocketInfo {
94
+
DOMString remoteAddress = null;
95
+
DOMString localAddress = null;
96
+
};
97
+
92
98
[Exposed=*]
93
99
interface Socket {
94
100
readonly attribute ReadableStream readable;
95
101
readonly attribute WritableStream writable;
96
102
97
-
readonly attribute Promise<undefined> opened;
103
+
readonly attribute Promise<SocketInfo> opened;
98
104
99
105
readonly attribute Promise<undefined> closed;
100
106
Promise<undefined> close(optional any reason);
@@ -162,6 +168,11 @@ The {{opened}} attribute is a promise that is resolved when the socket connectio
162
168
successfully established, or is rejected if the connection fails. For sockets use secure-transport,
163
169
the resolution of the {{opened}} promise indicates the completion of the secure handshake.
164
170
171
+
The {{opened}} promise resolves a {{SocketInfo}} dictionary that optionally provides details
172
+
about the connection that has been established.
173
+
174
+
By default, the {{opened}} promise is {{marked as handled}}.
175
+
165
176
<h4 id="closed-attribute">closed</h4>
166
177
167
178
The {{closed}} attribute is a promise which can be used to keep track of the socket state. It gets resolved under the
@@ -296,7 +307,7 @@ At any point during the creation of the {{Socket}} instance, `connect` may throw
296
307
{{secureTransport}} member
297
308
</dt>
298
309
<dd>
299
-
The secure transport mode to use.
310
+
The secure transport mode to use.f
300
311
<dl>
301
312
<dt>{{off}}</dt>
302
313
<dd>A connection is established in plain text.</dd>
@@ -321,6 +332,24 @@ At any point during the creation of the {{Socket}} instance, `connect` may throw
0 commit comments