InetServerBroadcast
INT InetServerBroadcast(
SOCKET hServer,  
LPBYTE lpBuffer, // pointer to buffer which contains data to send
INT cbBuffer  
);

The InetServerBroadcast function sends data to clients that are connected to the specified server.

Parameters

hClient
The socket handle.
lpBuffer
The pointer to the buffer which contains the data that is to be sent to the server clients.
cbBuffer
The number of bytes to send from the specified buffer.

Return Value

If the function succeeds, the return value is the number of clients that the data was sent to. If the function fails, the return value is INET_ERROR. To get extended error information, call InetGetLastError.

Remarks

The InetServerBroadcast function sends the contents of the buffer to all of the clients that are connected to the specified server. This function can only be used with a socket handle created using the InetServerStart function and cannot be used with sockets created using the InetListen or InetListenEx functions.

Requirements

Client: Requires Windows Vista, Windows XP or Windows 2000 Professional.
Server: Requires Windows Server 2008, Windows Server 2003 or Windows 2000 Server.
Header: Include cswsock6.h.
Library: Use cswskav6.lib.

See Also

InetClientBroadcast, InetServerStart, InetWrite, InetWriteLine


Copyright © 2008 Catalyst Development Corporation. All rights reserved.