> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nanoforge.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# UDPClient class

> Unreliable, unordered WebRTC data-channel client connection to a NanoForge UDP server.

# UDPClient

## Summary

Unreliable, unordered WebRTC data-channel client connection to a NanoForge UDP server.

## Signature

```typescript theme={null}
declare class UDPClient 
```

## Constructors

### constructor

Constructs a new instance of the class

## Methods

### connect

Open the WebSocket signaling channel, create an RTCPeerConnection, and complete the SDP/ICE handshake with the server.

### getReceivedPackets

Parse and return all complete packets received since the last call.

### isConnected

Return when the RTCDataChannel is open.

### sendData

Send a payload on the data channel.

## Remarks

Uses a WebSocket signaling channel to perform the SDP/ICE handshake and then communicates over an RTCDataChannel with `ordered: false` and `maxRetransmits: 0` for minimal latency.  Typical usage is through `NetworkClientLibrary` which instantiates and connects this class automatically during `__init`.
