Skip to content

Commit

Permalink
Add opened field to tcp-sockets.md docs (#13014)
Browse files Browse the repository at this point in the history
This was introduced recently in our API.
  • Loading branch information
dom96 authored Feb 15, 2024
1 parent 9cb9e01 commit e068233
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions content/workers/runtime-apis/tcp-sockets.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ export default {

{{</definitions>}}

### `SocketInfo`

{{<definitions>}}

- `remoteAddress` {{<type>}}string | null{{</type>}}
- The address of the remote peer the socket is connected to. May not always be set.

- `localAddress` {{<type>}}string | null{{</type>}}
- The address of the local network endpoint for this socket. May not always be set.

{{</definitions>}}

### `Socket`

{{<definitions>}}
Expand All @@ -86,6 +98,9 @@ export default {
- Returns the writable side of the TCP socket.
- The `WritableStream` returned only accepts chunks of `Uint8Array` or its views.

- `opened` {{<type>}}`Promise<SocketInfo>`{{</type>}}
- This promise is resolved when the socket connection is established and is rejected if the socket encounters an error.

- `closed` {{<type>}}`Promise<void>`{{</type>}}
- This promise is resolved when the socket is closed and is rejected if the socket encounters an error.

Expand Down

0 comments on commit e068233

Please sign in to comment.