Shadowrun: Awakened 29 September 2011 - Build 871
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Static Private Attributes
RakNet::SocketLayer Class Reference

#include <SocketLayer.h>

List of all members.

Public Member Functions

 SocketLayer ()
 Default Constructor.
 ~SocketLayer ()

Static Public Member Functions

static SOCKET CreateBoundSocket (unsigned short port, bool blockingSocket, const char *forceHostAddress, unsigned int sleepOn10048, unsigned int extraSocketOptions, unsigned short socketFamily)
static SOCKET CreateBoundSocket_Old (unsigned short port, bool blockingSocket, const char *forceHostAddress, unsigned int sleepOn10048, unsigned int extraSocketOptions)
static SOCKET CreateBoundSocket_PS3Lobby (unsigned short port, bool blockingSocket, const char *forceHostAddress, unsigned short socketFamily)
static SOCKET CreateBoundSocket_PSP2 (unsigned short port, bool blockingSocket, const char *forceHostAddress, unsigned short socketFamily)
static const char * DomainNameToIP (const char *domainName)
static const char * DomainNameToIP_Old (const char *domainName)
static bool GetFirstBindableIP (char firstBindable[128], int ipProto)
static unsigned short GetLocalPort (SOCKET s)
static void GetMyIP (SystemAddress addresses[10])
static SocketLayerOverrideGetSocketLayerOverride (void)
static RakNet::RakString GetSubNetForSocketAndIp (SOCKET inSock, RakNet::RakString inIpString)
static void GetSystemAddress (SOCKET s, SystemAddress *systemAddressOut)
static void GetSystemAddress_Old (SOCKET s, SystemAddress *systemAddressOut)
static bool IsPortInUse (unsigned short port, const char *hostAddress, unsigned short socketFamily)
static bool IsPortInUse_Old (unsigned short port, const char *hostAddress)
static bool IsSocketFamilySupported (const char *hostAddress, unsigned short socketFamily)
static void RecvFromBlocking (const SOCKET s, RakPeer *rakPeer, unsigned short remotePortRakNetWasStartedOn_PS3, unsigned int extraSocketOptions, char *dataOut, int *bytesReadOut, SystemAddress *systemAddressOut, RakNet::TimeUS *timeRead)
static void RecvFromBlocking_Old (const SOCKET s, RakPeer *rakPeer, unsigned short remotePortRakNetWasStartedOn_PS3, unsigned int extraSocketOptions, char *dataOut, int *bytesReadOut, SystemAddress *systemAddressOut, RakNet::TimeUS *timeRead)
static int SendTo (SOCKET s, const char *data, int length, SystemAddress &systemAddress, unsigned short remotePortRakNetWasStartedOn_PS3, unsigned int extraSocketOptions, const char *file, const long line)
static int SendTo_360 (SOCKET s, const char *data, int length, const char *voiceData, int voiceLength, const SystemAddress &systemAddress, unsigned int extraSocketOptions)
static int SendTo_PC (SOCKET s, const char *data, int length, const SystemAddress &systemAddress, const char *file, const long line)
static int SendTo_PS3Lobby (SOCKET s, const char *data, int length, const SystemAddress &systemAddress, unsigned short remotePortRakNetWasStartedOn_PS3)
static int SendTo_PSP2 (SOCKET s, const char *data, int length, const SystemAddress &systemAddress, unsigned short remotePortRakNetWasStartedOn_PS3)
static int SendToTTL (SOCKET s, const char *data, int length, SystemAddress &systemAddress, int ttl)
static void SetDoNotFragment (SOCKET listenSocket, int opt, int IPPROTO)
static void SetNonBlocking (SOCKET listenSocket)
static void SetSocketLayerOverride (SocketLayerOverride *_slo)
static void Write (const SOCKET writeSocket, const char *data, const int length)

Static Private Member Functions

static void SetSocketOptions (SOCKET listenSocket)

Static Private Attributes

static SocketLayerOverrideslo

Detailed Description

Definition at line 45 of file SocketLayer.h.


Constructor & Destructor Documentation

RakNet::SocketLayer::SocketLayer ( )
RakNet::SocketLayer::~SocketLayer ( )

Member Function Documentation

static SOCKET RakNet::SocketLayer::CreateBoundSocket ( unsigned short  port,
bool  blockingSocket,
const char *  forceHostAddress,
unsigned int  sleepOn10048,
unsigned int  extraSocketOptions,
unsigned short  socketFamily 
) [static]

Creates a bound socket to listen for incoming connections on the specified port

Parameters:
[in]portthe port number
[in]blockingSocket
Returns:
A new socket used for accepting clients
static SOCKET RakNet::SocketLayer::CreateBoundSocket_Old ( unsigned short  port,
bool  blockingSocket,
const char *  forceHostAddress,
unsigned int  sleepOn10048,
unsigned int  extraSocketOptions 
) [static]
static SOCKET RakNet::SocketLayer::CreateBoundSocket_PS3Lobby ( unsigned short  port,
bool  blockingSocket,
const char *  forceHostAddress,
unsigned short  socketFamily 
) [static]
static SOCKET RakNet::SocketLayer::CreateBoundSocket_PSP2 ( unsigned short  port,
bool  blockingSocket,
const char *  forceHostAddress,
unsigned short  socketFamily 
) [static]
static const char* RakNet::SocketLayer::DomainNameToIP ( const char *  domainName) [static]
static const char* RakNet::SocketLayer::DomainNameToIP_Old ( const char *  domainName) [static]
static bool RakNet::SocketLayer::GetFirstBindableIP ( char  firstBindable[128],
int  ipProto 
) [static]
static unsigned short RakNet::SocketLayer::GetLocalPort ( SOCKET  s) [static]
static void RakNet::SocketLayer::GetMyIP ( SystemAddress  addresses[10]) [static]

Retrieve all local IP address in a string format.

Parameters:
[in]sThe socket whose port we are referring to
[in]ipListAn array of ip address in dotted notation.
static SocketLayerOverride* RakNet::SocketLayer::GetSocketLayerOverride ( void  ) [inline, static]

Definition at line 143 of file SocketLayer.h.

{return slo;}
static RakNet::RakString RakNet::SocketLayer::GetSubNetForSocketAndIp ( SOCKET  inSock,
RakNet::RakString  inIpString 
) [static]

Given a socket and IP, retrieves the subnet mask, on linux the socket is unused

Parameters:
[in]inSockthe socket
[in]inIpStringThe ip of the interface you wish to retrieve the subnet mask from
Returns:
Returns the ip dotted subnet mask if successful, otherwise returns empty string ("")
static void RakNet::SocketLayer::GetSystemAddress ( SOCKET  s,
SystemAddress systemAddressOut 
) [static]
static void RakNet::SocketLayer::GetSystemAddress_Old ( SOCKET  s,
SystemAddress systemAddressOut 
) [static]
static bool RakNet::SocketLayer::IsPortInUse ( unsigned short  port,
const char *  hostAddress,
unsigned short  socketFamily 
) [static]
static bool RakNet::SocketLayer::IsPortInUse_Old ( unsigned short  port,
const char *  hostAddress 
) [static]

Returns if this specified port is in use, for UDP

Parameters:
[in]portthe port number
Returns:
If this port is already in use
static bool RakNet::SocketLayer::IsSocketFamilySupported ( const char *  hostAddress,
unsigned short  socketFamily 
) [static]
static void RakNet::SocketLayer::RecvFromBlocking ( const SOCKET  s,
RakPeer rakPeer,
unsigned short  remotePortRakNetWasStartedOn_PS3,
unsigned int  extraSocketOptions,
char *  dataOut,
int *  bytesReadOut,
SystemAddress systemAddressOut,
RakNet::TimeUS timeRead 
) [static]
static void RakNet::SocketLayer::RecvFromBlocking_Old ( const SOCKET  s,
RakPeer rakPeer,
unsigned short  remotePortRakNetWasStartedOn_PS3,
unsigned int  extraSocketOptions,
char *  dataOut,
int *  bytesReadOut,
SystemAddress systemAddressOut,
RakNet::TimeUS timeRead 
) [static]

Read data from a socket

Parameters:
[in]sthe socket
[in]rakPeerThe instance of rakPeer containing the recvFrom C callback
[in]errorCodeAn error code if an error occured .
[in]connectionSocketIndexWhich of the sockets in RakPeer we are using
Returns:
Returns true if you successfully read data, false on error.
static int RakNet::SocketLayer::SendTo ( SOCKET  s,
const char *  data,
int  length,
SystemAddress systemAddress,
unsigned short  remotePortRakNetWasStartedOn_PS3,
unsigned int  extraSocketOptions,
const char *  file,
const long  line 
) [static]

Call sendto (UDP obviously)

Parameters:
[in]sthe socket
[in]dataThe byte buffer to send
[in]lengthThe length of the data in bytes
[in]binaryAddressThe address of the remote host in binary format.
[in]portThe port number to send to.
Returns:
0 on success, nonzero on failure.
static int RakNet::SocketLayer::SendTo_360 ( SOCKET  s,
const char *  data,
int  length,
const char *  voiceData,
int  voiceLength,
const SystemAddress systemAddress,
unsigned int  extraSocketOptions 
) [static]
static int RakNet::SocketLayer::SendTo_PC ( SOCKET  s,
const char *  data,
int  length,
const SystemAddress systemAddress,
const char *  file,
const long  line 
) [static]
static int RakNet::SocketLayer::SendTo_PS3Lobby ( SOCKET  s,
const char *  data,
int  length,
const SystemAddress systemAddress,
unsigned short  remotePortRakNetWasStartedOn_PS3 
) [static]
static int RakNet::SocketLayer::SendTo_PSP2 ( SOCKET  s,
const char *  data,
int  length,
const SystemAddress systemAddress,
unsigned short  remotePortRakNetWasStartedOn_PS3 
) [static]
static int RakNet::SocketLayer::SendToTTL ( SOCKET  s,
const char *  data,
int  length,
SystemAddress systemAddress,
int  ttl 
) [static]

Call sendto (UDP obviously)

Parameters:
[in]sthe socket
[in]dataThe byte buffer to send
[in]lengthThe length of the data in bytes
[in]ipThe address of the remote host in dotted notation.
[in]portThe port number to send to.
Returns:
0 on success, nonzero on failure. Call sendto (UDP obviously) It won't reach the recipient, except on a LAN However, this is good for opening routers / firewalls
Parameters:
[in]sthe socket
[in]dataThe byte buffer to send
[in]lengthThe length of the data in bytes
[in]ipThe address of the remote host in dotted notation.
[in]portThe port number to send to.
[in]ttlMax hops of datagram
Returns:
0 on success, nonzero on failure.
static void RakNet::SocketLayer::SetDoNotFragment ( SOCKET  listenSocket,
int  opt,
int  IPPROTO 
) [static]
static void RakNet::SocketLayer::SetNonBlocking ( SOCKET  listenSocket) [static]

Sets the socket flags to nonblocking

Parameters:
[in]listenSocketthe socket to set
static void RakNet::SocketLayer::SetSocketLayerOverride ( SocketLayerOverride _slo) [static]
static void RakNet::SocketLayer::SetSocketOptions ( SOCKET  listenSocket) [static, private]
static void RakNet::SocketLayer::Write ( const SOCKET  writeSocket,
const char *  data,
const int  length 
) [static]

Write data of length length to writeSocket

Parameters:
[in]writeSocketThe socket to write to
[in]dataThe data to write
[in]lengthThe length of data

Member Data Documentation

Definition at line 159 of file SocketLayer.h.


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

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net