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.
History
| Release | Changes |
|---|---|
| 20 R9 | New address and port attributes |
| 20 R8 | Class added |
TCPEvent Object
A TCPEvent object is immutable and non-streamable.
The following properties are available:
| address : Text the IP address of the remote machine |
| data : Blob the data associated with the event |
| port : Number the port number of the remote machine |
| type : Text the type of the event |
.address
address : Text
Description
The .address property contains the IP address of the remote machine.
.data
data : Blob
Description
The .data property contains the data associated with the event. It is only valid for events of type "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
Description
The .port property contains the port number of the remote machine.
.type
type : Text
Description
The .type property contains the type of the event. Possible values are:
"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.