Applies To:
  • CitectSCADA 5.40

Summary:
We need to provide high-level drivers with the possibility to handle winsock events.
 

Solution:
The driver was updated to detect the following events:
FD_OOB, FD_ACCEPT, FD_CONNECT, FD_CLOSE

The DATA_ALL_EVENTS callback is made when any of the events (FD_READ, FD_WRITE, FD_OOB, FD_ACCEPT, FD_CONNECT, FD_CLOSE) is received from the connection. The callback is used to inform the high level driver about the event that was received.
When the high-level driver registers for DATA_ALL_EVENTS, callback function will be executed first.
Processing the events in TCP/IP driver will depend on the value returned by this function (TRUE: TCP/IP driver continues to process the events, FALSE: Only high-level driver is processing the events).
In the high level driver (e.g. Yokfam), DATA_ALL_EVENTS callback function should be implemented as follows:

BOOLEAN Eventcallback (short ChannelNumber, long event, short error);

Example:
BOOLEAN Eventcallback (short ChannelNumber, long event,
short error)
{
    switch (event)
    {
        case FD_OOB:
            // High-level driver implementation
            break;
        case FD_ACCEPT:
            // High-level driver implementation
            break;
        case FD_CONNECT:
            // High-level driver implementation
            break;
        case FD_CLOSE:
            // High-level driver implementation
            break;
    }
    return TRUE; // Allow TCP/IP driver to proceed with its
    // events handling.
    // A FALSE means TCPIP driver does not
    // handle this event.
}

Reregister the function with the following call:
COMSetVector(ChannelNumber, Eventcallback, pDcb->Channel, DATA_ALL_EVENTS)

Keywords:
 

Attachments