NAME
CL_Network - Network component class. Starting place for all net activity in ClanLib.
CLASS MEMBERS
- static void find_games_broadcast(
-
std::string game_id, int port)
- static void find_game_at(
-
std::string game_id, const char *host_address, int port)
- static bool peek_game_found()
- static CL_NetGame *receive_game_found(
-
int timeout_millis)
- static void clear_games_found()
- static CL_NetGame *create_game(
-
std::string game_id, int port)
MEMBERS WITH DESCRIPTIONS
- static void find_games_broadcast(
-
std::string game_id, int port)
Parameters: game_id - The game's ID used to locate this type of game with. port - Broadcast UDP port.
Description:
Searchs for games using UDP broadcasting at the specified port. Only games with the same game_id are added to CL_Network::netgames.
- static void find_game_at(
-
std::string game_id, const char *host_address, int port)
Parameters: host_address - IP address or hostname of the computer to be contacted. port - Port which the computer contacted listens on.
Description:
Searchs for games at the specified host address and port (port).
- static bool peek_game_found()
-
Description:
Returns true if any netgames have been found. Use receive_game_found() toget the individual games found.
Return value:
True if any netgames have been found.
- static CL_NetGame *receive_game_found(
-
int timeout_millis)
Parameters: timeout_millis - Timeout before returning if no game was found.
Description:
Returns the first netgame found. It is then removed from the list of gamesfound. Next time it is called it will return the next in available. The function is blocking until the specified timeout runs out.If set to zero, it will block forever until a game has been found.Remember to delete the netgame returned after usage.
Return value:
The netgame found, or NULL if timed out. Remember to delete the netgame after usage.
- static void clear_games_found()
-
Description:
Clears the list of games found.
- static CL_NetGame *create_game(
-
std::string game_id, int port)
Parameters: game_id - The game ID is used to locate netgames of the same type. port - Port the game accepts connections on - and listens for broadcasts.
Description:
Creates a new network game.
Return value:
The created network game.
SEE ALSO
All ClanLib API classes can be found in clanlib (3).
AUTHORS
Originally written by Magnus Norddahl <[email protected]> and Martin Starch <[email protected]>. ClanLib is now developed by the ClanLib Development team as an Open Source project.
The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at http://somewhere.in.the.world.org).
See clanlib (3) to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.