2022-10-21 17:16:00 +02:00
|
|
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [getPortHandle](./bitburner.ns.getporthandle.md)
|
|
|
|
|
|
|
|
## NS.getPortHandle() method
|
|
|
|
|
|
|
|
Get all data on a port.
|
|
|
|
|
2023-02-11 19:18:50 +01:00
|
|
|
**Signature:**
|
2022-10-21 17:16:00 +02:00
|
|
|
|
|
|
|
```typescript
|
2023-02-28 01:54:04 +01:00
|
|
|
getPortHandle(portNumber: number): NetscriptPort;
|
2022-10-21 17:16:00 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --- | --- | --- |
|
2023-02-28 01:54:04 +01:00
|
|
|
| portNumber | number | Port number. Must be an integer between 1 and 20. |
|
2022-10-21 17:16:00 +02:00
|
|
|
|
2023-02-11 19:18:50 +01:00
|
|
|
**Returns:**
|
2022-10-21 17:16:00 +02:00
|
|
|
|
|
|
|
[NetscriptPort](./bitburner.netscriptport.md)
|
|
|
|
|
|
|
|
## Remarks
|
|
|
|
|
|
|
|
RAM cost: 0 GB
|
|
|
|
|
|
|
|
Get a handle to a Netscript Port.
|
|
|
|
|
|
|
|
WARNING: Port Handles only work in NetscriptJS (Netscript 2.0). They will not work in Netscript 1.0.
|
|
|
|
|