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.
Historia
| Lanzamiento | Modificaciones | 
|---|---|
| 20 R9 | Nuevos atributos addressyport | 
| 20 R8 | Clase añadida | 
Objeto TCPEvent
Un objeto TCPEvent es inmutable y no se puede transmitir.
Las siguientes propiedades están disponibles:
| address : Text the IP address of the remote machine | 
| data : Blob los datos asociados al evento | 
| port : Number el número de puerto de la máquina remota | 
| type : Text el tipo del evento | 
.address
address : Text
Descripción
The .address property contains the IP address of the remote machine.
.data
data : Blob
Descripción
La propiedad .data contiene los datos asociados al evento. Sólo es válido para eventos de tipo "data".
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.
.port
port : Number
Descripción
La propiedad .port contiene el número de puerto de la máquina remota.
.type
type : Text
Descripción
La propiedad .type contiene el tipo del evento. Los valores posibles son:
- "connection": Indicates that a TCPConnection was successfully established.
- "data": indica que los datos han sido recibidos.
- "error": indica que se ha producido un error durante la TCPConnection.
- "close": indica que la TCPConnection ha sido correctamente cerrada.
- "terminate": indica que el TCPConnection está a punto de ser liberado.