nlPollGroup

check the read or write status of all sockets in a group

C Specification

NLint nlPollGroup(NLint group, NLenum name, NLsocket *socket, NLint number,
NLint timeout)

Parameters

group

[in]Specifies the group to use.

name

[in]Which status, read or write, to poll

socket

[in/out]Specifies the socket pointer allocated by the caller.

number

[in]Specifies the length of socket.
timeout

[in]Specifies the timeout in milliseconds, or negative (-1) for full blocking.

Description

nlPollGroup polls the read or write status of all sockets in group. socket should be allocated to hold at least the number of sockets that have been added to group. socket will be filled with a list of the sockets that are ready to read or write. nlPollGroup will time out according to the setting of timeout. Use 0 for a normal non-blocking call, or use -1 to block until at least one socket is readable or writeable. Valid enumerants for name are:

NL_READ_STATUS : Poll the read status.

NL_WRITE_STATUS : Poll the write status.

NOTE: In a multithreaded application, if a socket in the group is closed by another thread, nlPollGroup will unblock and return an error.

Return values

The number of sockets that are ready, or NL_INVALID if an error occurred.

Error codes

NL_INVALID_GROUP : The group is not valid.
NL_INVALID_ENUM : The property name is not valid.
NL_NULL_POINTER : A NULL pointer was passed to this function.
NL_BUFFER_SIZE : socket is not large enough to hold all the returned sockets, try again with a larger buffer.
NL_INVALID_SOCKET : A socket in the group has been closed and not removed from the group, or a socket was closed by another thread in a multithreaded application.
NL_SYSTEM_ERROR : A system Socket error has ocurred. The system error can be retrieved by calling nlGetSystemError.

See also

nlGroupCreate,
nlGroupDestroy,
nlGroupAddSocket,
nlGroupDeleteSocket


Back to the HawkNL index page


Go directly to the main HawkNL page at Hawk Software

© 2000-2002 Phil Frisbie.

Valid XHTML 1.0!