Skip to content

@pumpkin-plugins/upnpumpkin API / port-mapping / Connection

Interface: Connection ​

Defined in: tools/port-mapping/src/network.ts:20

A TCP connection that is never waited on.

Properties ​

localAddress ​

readonly localAddress: Ipv4

Defined in: tools/port-mapping/src/network.ts:22

The address of this machine on the network the connection uses.

Methods ​

close() ​

close(): void

Defined in: tools/port-mapping/src/network.ts:30

Releases the connection. Safe to call twice.

Returns ​

void


read() ​

read(max): Uint8Array<ArrayBufferLike> | "closed" | null

Defined in: tools/port-mapping/src/network.ts:24

Up to max bytes, null when nothing has arrived yet, 'closed' when the peer is gone.

Parameters ​

max ​

number

Returns ​

Uint8Array<ArrayBufferLike> | "closed" | null


writable() ​

writable(): number

Defined in: tools/port-mapping/src/network.ts:26

How many bytes can be written right now.

Returns ​

number


write() ​

write(bytes): void

Defined in: tools/port-mapping/src/network.ts:28

Queues bytes for sending. At most writable() bytes at a time.

Parameters ​

bytes ​

Uint8Array

Returns ​

void

Pumpkin Plugins documentation