Saltar para o conteúdo principal
Versão: Próximo

TCPEvent

The TCPEvent class provides information about events occurring during the lifecycle of a TCP connection. It is generated when a TCPConnection is opened and is typically utilized in callbacks such as onConnection, onData, onError, and others.

História
ReleaseMudanças
20 R9New ip, and port attributes
20 R8Classe adicionada

TCPEvent Object

A TCPEvent object is immutable and non-streamable.

As seguintes propriedades estão disponíveis:

data : Blob
os dados associados ao evento
ip : Text
o endereço IP da máquina remota
port : Number
o número da porta da máquina remota
type : Text
o tipo do evento

.data

data : Blob

Descrição

A propriedade .data contém os dados associados ao evento. It is only valid for events of type "data".

nota

When working with low-level TCP/IP connections, keep in mind there is no guarantee that all data will arrive in a single packet. Data arrives in order but may be fragmented across multiple packets.

.ip

ip : Text

Descrição

A propriedade .ip contém o endereço IP da máquina remota.

.port

port : Number

Descrição

A propriedade .port contém o número da porta da máquina remota .

.type

type : Text

Descrição

A propriedade .type contém o tipo do evento. Valores possíveis:

  • "connection": Indicates that a TCPConnection was successfully established.
  • "data": Indicates that data has been received.
  • "error": Indicates that an error occurred during the TCPConnection.
  • "close": Indicates that the TCPConnection has been properly closed.
  • "terminate": Indicates that the TCPConnection is about to be released.