> ## 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.

# TCPClient class

> Reliable, ordered WebSocket-based client connection to a NanoForge TCP server.

# TCPClient

## Summary

Reliable, ordered WebSocket-based client connection to a NanoForge TCP server.

## Signature

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

## Constructors

### constructor

Constructs a new instance of the class

## Methods

### connect

Initiate a WebSocket connection to the server.

### getReceivedPackets

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

### isConnected

Return when the underlying WebSocket is open.

### sendData

Send a payload to the server.

## Remarks

Packets are framed with a configurable magic delimiter so that partial WebSocket frames can be reassembled. The connection is established by calling `connect` and status can be queried with `isConnected`.  Typical usage is through `NetworkClientLibrary` which instantiates and connects this class automatically during `__init`.
