"L. Spiro Engine"
Static Public Member Functions | Static Protected Attributes

lsn::CNetLib Class Reference

The network manager main header. More...

#include <LSNNetLib.h>

List of all members.

Static Public Member Functions

static LSBOOL LSE_CALL InitNetwork ()
static LSVOID LSE_CALL ShutDownNetwork ()
static LSN_SOCKET LSE_CALL CreateUpdSocket ()
static LSVOID LSE_CALL CloseSocket (LSN_SOCKET _sSock)
static LSBOOL LSE_CALL CheckSocket (LSN_SOCKET _sSock)
static LSN_ADDRESS LSE_CALL LookUpAddress (const LSCHAR *_pcName=NULL)
static LSBOOL LSE_CALL GetHostName (CString &_sReturn)
static LSUINT32 LSE_CALL Bind (LSN_SOCKET _sSock, LSUINT16 _ui16Port, LSN_ADDRESS _aAddress=0)
static LSUINT32 LSE_CALL SendTo (LSN_ADDRESS _aAddress, LSUINT16 _ui16Port, const LSVOID *_pvData, LSUINT32 _ui32Len, LSN_SOCKET _sSocket)
static LSUINT32 LSE_CALL ReceiveFrom (LSN_SOCKET _sSocket, LSVOID *_pvData, LSUINT32 _ui32Len, LSN_ADDRESS &_aAddress, LSUINT16 &_ui16Port)

Static Protected Attributes

static LSUINT32 m_ui32InitCount

Detailed Description

The network manager main header.

Class CNetLib Description: The network manager main header. All files in the network module include this first.


Member Function Documentation

static LSUINT32 LSE_CALL lsn::CNetLib::Bind ( LSN_SOCKET  _sSock,
LSUINT16  _ui16Port,
LSN_ADDRESS  _aAddress = 0 
) [static]

Bind a socket to the given IP address and port. If no IP address is supplied, the host name is used.

Parameters:
_sSockThe socket to bind.
_ui16PortThe port to which to bind the socket.
_aAddressThe address to which to bind the socket.
Returns:
Returns an error code.
static LSBOOL LSE_CALL lsn::CNetLib::CheckSocket ( LSN_SOCKET  _sSock) [static]

Check a socket to see if it is valid.

Parameters:
_sSockThe socket to check.
Returns:
Returns true if the given socket is not invalid.
static LSVOID LSE_CALL lsn::CNetLib::CloseSocket ( LSN_SOCKET  _sSock) [static]

Close a created socket.

Parameters:
_sSockThe socket to close.
static LSN_SOCKET LSE_CALL lsn::CNetLib::CreateUpdSocket ( ) [static]

Create a non-blocking UDP socket.

Returns:
Returns the created UDP socket.
static LSBOOL LSE_CALL lsn::CNetLib::GetHostName ( CString &  _sReturn) [static]

Get the host name. Attempts to wait through blocking operations.

Parameters:
_sReturnHolds the returned host name.
Returns:
Returns true if the host name was resolved.
static LSBOOL LSE_CALL lsn::CNetLib::InitNetwork ( ) [static]

Initialize the network library.

Returns:
Returns false if the required network resources are unavailable.
static LSN_ADDRESS LSE_CALL lsn::CNetLib::LookUpAddress ( const LSCHAR *  _pcName = NULL) [static]

Resolve an address (including domain names) to an IP address.

Parameters:
_pcNameHost name to resolve.
Returns:
Returns the IP of the given host name or LSN_NO_ADDRESS if none could be determined.
static LSUINT32 LSE_CALL lsn::CNetLib::ReceiveFrom ( LSN_SOCKET  _sSocket,
LSVOID *  _pvData,
LSUINT32  _ui32Len,
LSN_ADDRESS &  _aAddress,
LSUINT16 &  _ui16Port 
) [static]

Receive a packet from any connection. The address of the sender is returned.

Parameters:
_sSocketThe socket through which to receive the data.
_pvDataBuffer to hold the received data, if any.
_ui32LenThe length in bytes of the buffer to which _pvData points.
_aAddressThe sender's address.
_ui16PortThe sender's port.
Returns:
Returns the number of bytes received or an error code.
static LSUINT32 LSE_CALL lsn::CNetLib::SendTo ( LSN_ADDRESS  _aAddress,
LSUINT16  _ui16Port,
const LSVOID *  _pvData,
LSUINT32  _ui32Len,
LSN_SOCKET  _sSocket 
) [static]

Send a packet to a given address.

Parameters:
_aAddressThe address.
_ui16PortThe port.
_pvDataThe data to send.
_ui32LenThe length in bytes of the data to send.
_sSocketThe socket through which to send the data.
Returns:
Returns an error code.
static LSVOID LSE_CALL lsn::CNetLib::ShutDownNetwork ( ) [static]

Shut down the network library.


Member Data Documentation

LSUINT32 lsn::CNetLib::m_ui32InitCount [static, protected]

Count of successful initializations.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator