Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Dec 28, 2023
1 parent ad81fc4 commit 53d33de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/runtime/src/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export function chdir(dir: PathLike) {
* Creates a TCP connection to the specified `address`.
*
* @param address Hostname and port number of the destination TCP server to connect to.
* @param opts Optional
* @param opts Socket options, for example to create a secure TLS connection.
* @see https://sockets-api.proposal.wintercg.org
*/
export function connect<Host extends string, Port extends string>(
Expand All @@ -222,6 +222,11 @@ export function connect<Host extends string, Port extends string>(
);
}

/**
* Creates a TCP server bound to the specified `port` number.
*
* @param opts Object containing the port number and other configuration properties.
*/
export function listen(opts: ListenOptions) {
const { ip = '0.0.0.0', port, accept } = opts;
const server = createServer(ip, port);
Expand Down

0 comments on commit 53d33de

Please sign in to comment.