"L. Spiro Engine"
Static Public Member Functions

lsn::CPosixSock Class Reference

The interface for the Posix Socks sockets implementation. More...

#include <LSNPosixSock.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)
static LSBOOL LSE_CALL GetHostName (CString &_sReturn)
static LSUINT32 LSE_CALL Bind (LSN_SOCKET _sSock, LSUINT16 _ui16Port, LSN_ADDRESS _aAddress=LSN_NO_ADDRESS)
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)

Detailed Description

The interface for the Posix Socks sockets implementation.

Class CPosixSock Description: The interface for the Posix Socks sockets implementation. Our interface is the same as for any other sockets implementation.


Member Function Documentation

static LSUINT32 LSE_CALL lsn::CPosixSock::Bind ( LSN_SOCKET  _sSock,
LSUINT16  _ui16Port,
LSN_ADDRESS  _aAddress = LSN_NO_ADDRESS 
) [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::CPosixSock::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::CPosixSock::CloseSocket ( LSN_SOCKET  _sSock) [static]

Close a created socket.

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

Create a non-blocking UDP socket.

Returns:
Returns the created UDP socket.
static LSBOOL LSE_CALL lsn::CPosixSock::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::CPosixSock::InitNetwork ( ) [static]

Initializes the network library for use with Posix Socks.

Returns:
Returns true.
static LSN_ADDRESS LSE_CALL lsn::CPosixSock::LookUpAddress ( const LSCHAR *  _pcName) [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::CPosixSock::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::CPosixSock::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::CPosixSock::ShutDownNetwork ( ) [static]

Shuts down the network library.


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