<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [nextPortWrite](./bitburner.ns.nextportwrite.md)

## NS.nextPortWrite() method

Listen for a port write.

**Signature:**

```typescript
nextPortWrite(port: number): Promise<void>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

port


</td><td>

number


</td><td>

Port to listen for a write on. Must be a positive integer.


</td></tr>
</tbody></table>

**Returns:**

Promise&lt;void&gt;

## Remarks

RAM cost: 0 GB

Sleeps until the port is written to. Ports are shared across all hosts and contents are reset on game restart.

