/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Bytes, ChannelType, ConnectedChannel, IpNetworkChannel, Observable, ServerAddressIp, ServerAddressTcp, TcpConnection, Transport } from "@matter/general"; /** * TCP channel implementing Matter message framing. * * Each message is prefixed with a 4-byte little-endian uint32 length header indicating the number of message bytes * that follow. Incoming data is buffered and reassembled into complete messages before being emitted. * * The {@link maxPayloadSize} is the maximum message size excluding the 4-byte length header, as MAX_TCP_MESSAGE_SIZE * defines it. It is our receive limit and also the ceiling for what we send, so a lower receive limit also lowers the * messages we send even to a peer that accepts more. * * @see {@link MatterSpecification.v161.Core} ยง 4.13.1 */ export declare class TcpChannel implements IpNetworkChannel, ConnectedChannel { #private; readonly isReliable: true; readonly supportsLargeMessages = true; readonly type = ChannelType.TCP; readonly maxPayloadSize: number; readonly networkAddressChanged: Observable<[ServerAddressIp], void>; constructor(socket: TcpConnection, maxPayloadSize?: number, isIncoming?: boolean); get name(): string; get networkAddress(): ServerAddressTcp; send(data: Bytes): Promise; /** * Register a listener for complete, deframed messages. */ onMessage(listener: (data: Bytes) => void): Transport.Listener; /** * Register a listener for connection close. */ onClose(listener: () => void): Transport.Listener; close(): Promise; [Symbol.asyncIterator](): AsyncIterator; } //# sourceMappingURL=TcpChannel.d.ts.map