Navigation:  thinBasic Modules > TcpUdp (Networking) > UDP functions >

UDP_Notify

Previous pageReturn to chapter overviewNext page

 

Description

 

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

 

Syntax

 

n = UDP_Notify(nFile, EventType, hWnd, nMessage)

 

Returns

 

Number.

 

Parameters

 

Name

Type

Optional

Meaning

nFile

Number

No

Previously opened file number

EventType

Number

No

Event type to be trapped. Can be one of the following equates:

%NOTIFY_READ
%NOTIFY_WRITE
%NOTIFY_CLOSE

hWnd

Number

No

UI Window handle whose callback will receive the message

wMessage

Number

No

Window message to be passed to Window callback.

This value should be equal or larger than %WM_USER + 500 to avoid conflict with other (common) callback message values.

 

Remarks

 

When the callback function receives the wMessage notification, CBWPARAM identifies the operating system's handle of the socket, the low-order Word of CBLPARAM specifies the code of the event (see table below), and the high-order Word of CBLPARAM contains the error code (if any).

 

LO(WORDCBLPARAM) can be one of the following:

%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 a %FD_READ notification is received, it will not be resent until after a UDP_RECV statement is executed.

 

Restrictions

 

See also

 

Examples