<< Click to Display Table of Contents >> Navigation: ThinBASIC Modules > TcpUdp (Networking) > TCP functions > TCP_Notify |
Description
Designate which TCP/IP events will generate a notification message.
Syntax
n = TCP_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_ACCEPT •%NOTIFY_CONNECT •%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(WORD, CBLPARAM) 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_ACCEPT The socket is able to accept a new connection.
%FD_CONNECT The connection has been established.
%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 TCP_RECV statement is executed.
Restrictions
See also
Examples