CrystalSpace

Public API Reference

CS::Network::Socket::iSocketManager Struct Reference

The iSocketManager interface is the main interface for socket usage. More...

#include <inetwork/socket.h>

Inheritance diagram for CS::Network::Socket::iSocketManager:

List of all members.

Public Member Functions

virtual csPtr< iSocketCreateSocket (Family family, Protocol protocol) const =0
 Create a socket for the specified address family and transport protocol.
virtual size_t GetSelectLimit () const =0
 Get the amount of sockets that can be selected for reading and writing respectively in a single call.
virtual csPtr< iAddressResolve (char const *host, char const *service, Family family, Protocol protocol) const =0
 Resolves an address for usage with sockets using the specified address family and transport protocol.
virtual void Select (iSocketArray *read, iSocketArray *write) const =0
 Selects sockets which are ready for processing from a given set of sockets.

Detailed Description

The iSocketManager interface is the main interface for socket usage.

It's used to create sockets, resolve addresses and select sockets which are ready for processing.

Definition at line 201 of file socket.h.


Member Function Documentation

virtual csPtr<iSocket> CS::Network::Socket::iSocketManager::CreateSocket ( Family  family,
Protocol  protocol 
) const [pure virtual]

Create a socket for the specified address family and transport protocol.

Returns a new socket on success, nullptr otherwise.

virtual size_t CS::Network::Socket::iSocketManager::GetSelectLimit (  )  const [pure virtual]

Get the amount of sockets that can be selected for reading and writing respectively in a single call.

virtual csPtr<iAddress> CS::Network::Socket::iSocketManager::Resolve ( char const *  host,
char const *  service,
Family  family,
Protocol  protocol 
) const [pure virtual]

Resolves an address for usage with sockets using the specified address family and transport protocol.

The host may be either a formatted address suitable for the address family, a name that resolves to such an address using name lookup or nullptr in which case the local loopback address for this family will be used.

The service name may either be the textual representation of an integer specifying a service location at the specified address or a name that resolves to such an integer using service name lookup procedures.

If the host and the service could be resolved for the given address family and transport protocol a valid address for usage with sockets of this type will be returned, otherwise nullptr will be returned.

virtual void CS::Network::Socket::iSocketManager::Select ( iSocketArray read,
iSocketArray write 
) const [pure virtual]

Selects sockets which are ready for processing from a given set of sockets.

Sockets specified in read and write will be checked whether they can be read or written respectively without blocking and only those who can will remain in the arrays upon completion.

Note that only a platform specific amount of sockets can be checked for each processing type at once and while you may pass more to check any further ones will be ignored and accordingly not remain in the ouput arrays. You can query the amount of sockets that can be checked at once using GetSelectLimit().


The documentation for this struct was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1