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
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ A socket becomes <i>closed</i> when its {{close()}} method is called. A socket c
44
44
45
45
A socket can be constructed using a <dfn export id="connect-concept">connect</dfn> method defined in a `sockets` module (early implementations may use `vendor:sockets` for the module name), or defined on a [=binding object=].
46
46
47
-
The connect method is the primary mechanism for creating a [=socket=] instance. It instantiates a socket with a resource identifier and some configuration values. It should synchronously return a socket instance in a <i>connected</i> state (or an error should be thrown).
47
+
The connect method is the primary mechanism for creating a [=socket=] instance. It instantiates a socket with a resource identifier and some configuration values. It should synchronously return a socket instance in a <i>pending</i> state (or an error should be thrown). The socket will asynchronously <i>connect</i> depending on the implementation.
The {{connect()}} method performs the following steps:
263
263
264
264
<ol>
265
-
<li>A connection is established to the specified {{SocketAddress}} asynchronously.</li>
266
265
<li>New {{Socket}} instance is created with each of its attributes initialised immediately.</li>
267
-
<li>The created {{Socket}} instance is returned immediately.</li>
266
+
<li>The created {{Socket}} instance is returned immediately in a <i>pending</i> state.</li>
267
+
<li>A connection is established to the specified {{SocketAddress}} asynchronously.</li>
268
268
<li>If the connection fails for any reason, the socket's {{closed}} promise is rejected with a [=SocketError=] describing why the connection failed.</li>
269
269
<li>The instance's {{ReadableStream}} and {{WritableStream}} streams can be used immediately.</li>
0 commit comments