Method ITcIoTcpProtocolRecv:ReceiveEvent
Is called by the TCP/UDP RT module as a callback if an event has occurred.
Syntax
HRESULT TCOMAPI ReceiveEvent(ULONG socketId, TCPIP_EVENT tcpEvent)
Return value
Name | Type | Description |
---|---|---|
ReceiveEvent | HRESULT | Indicates success and must be provided accordingly by the implemented module. |
Parameter
Name | Type | Description |
---|---|---|
socketId | ULONG | The socket on which data was received. |
tcpEvent | TCP_EVENT | An element of the Enum. |
The enumeration TCP_EVENT refers to different events, which can occur with a TCP connection:
enum TCPIP_EVENT : ULONG {
TCPIP_EVENT_NONE = 0,
TCPIP_EVENT_ERROR = 1,
TCPIP_EVENT_RESET = 2,
TCPIP_EVENT_TIMEOUT = 3,
TCPIP_EVENT_CONN_ESTABLISHED = 4,
TCPIP_EVENT_CONN_INCOMING = 5,
TCPIP_EVENT_CONN_CLOSED = 6,
TCPIP_EVENT_CONN_IDLE = 7,
TCPIP_EVENT_DATA_RECEIVED = 8,
TCPIP_EVENT_DATA_SENT = 9,
TCPIP_EVENT_KEEP_ALIVE = 10,
TCPIP_EVENT_LINKCONNECT = 11,
TCPIP_EVENT_LINKDISCONNECT = 12
};
An implementation of the method should provide a switch case over all elements, so that the system can respond according to the event.
The application of events for a TCP server is described in the interface overview.