UDP NOTIFY statement

Purpose

Designate which UDP/IP events will generate a notification message.

Syntax

UDP NOTIFY [#] fNum&, {SEND | RECV | CLOSE} TO hWnd& AS wMsg&

Remarks

Designates which events (SEND, RECV, and CLOSE) will generate a notification wMsg& message, to be sent to the window/dialog procedure (CALLBACK), identified by the window handle hWnd&.

Your program defines the wMsg& value, and this value should be equal or larger than %WM_USER + 500, to avoid conflict with common Windows callback message values.

When the nominated Callback Function receives the wMsg& notification, the wParam& parameter identifies the operating system's handle of the socket (see FILEATTR).  The low-order Word of lParam& specifies the code of the event (see table below), and the high-order Word of lParam& contains the error code (if any).

LO(WORD, lParam&)

Definition

%FD_READ

Data is available to be read from the socket.

%FD_WRITE

The socket is ready for data to be written.

%FD_CLOSE

The socket has been closed.

Notification messages do not arrive in unabated or continuous streams.  That is, once a particular notification message arrives, it will not be sent again until the initial message is acted upon.  For example, if an %FD_READ notification is received for a particular socket, it will not be resent until after a UDP RECV statement is executed.

The Winsock error codes are listed in WINSOCK2.INC, prefixed with %WSAE.

See also

FILEATTR, TCP and UDP Communication, TCP NOTIFY, UDP CLOSE, UDP OPEN, UDP RECV, UDP SEND