Net

Engine/source/platform/platformNet.h

Platform-specific network operations.

More...

Public Types

enum
ConnectionState {
  DNSResolved 
  DNSFailed 
  Connected 
  ConnectFailed 
  Disconnected 
}
enum
Error {
  NoError 
  WrongProtocolType 
  InvalidPacketProtocol 
  WouldBlock 
  NotASocket 
  UnknownError 
  NeedHostLookup 
}

Public Static Functions

accept(NetSocket acceptSocket, NetAddress * remoteAddress)
addressToString(const NetAddress * address, char addressString)
bindAddress(const NetAddress & address, NetSocket socket, bool useUDP)
connect(NetSocket socket, const NetAddress * address)
getListenAddress(const NetAddress::Type type, NetAddress * address, bool forceDefaults)

Gets the desired default listen address for a specified address type.

bool
init()
listen(NetSocket socket, S32 maxConcurrentListens)
openConnectTo(const char * stringAddress)
bool
openPort(S32 connectPort, bool doBind)
recv(NetSocket socket, U8 * buffer, S32 bufferSize, S32 * bytesRead)
send(NetSocket socket, const U8 * buffer, S32 bufferSize, S32 * outBytesWritten)
sendto(const NetAddress * address, const U8 * buffer, S32 bufferSize)
sendtoSocket(NetSocket socket, const U8 * buffer, S32 bufferSize, S32 * bytesWritten)
setBlocking(NetSocket socket, bool blockingIO)
setBroadcast(NetSocket socket, bool broadcastEnable)
setBufferSize(NetSocket socket, S32 bufferSize)
stringToAddress(const char * addressString, NetAddress * address, bool hostLookup, int family)

Private Static Functions

Detailed Description

Platform-specific network operations.

Public Types

ConnectionState

Enumerator

DNSResolved
DNSFailed
Connected
ConnectFailed
Disconnected
Error

Enumerator

NoError
WrongProtocolType
InvalidPacketProtocol
WouldBlock
NotASocket
UnknownError
NeedHostLookup

Public Static Attributes

const S32 MaxPacketDataSize 
ConnectionAcceptedEvent * smConnectionAccept 
ConnectionNotifyEvent * smConnectionNotify 
ConnectionReceiveEvent * smConnectionReceive 
bool smIpv4Enabled 
bool smIpv6Enabled 
bool smMulticastEnabled 
PacketReceiveEvent * smPacketReceive 

Public Static Functions

accept(NetSocket acceptSocket, NetAddress * remoteAddress)

addressToString(const NetAddress * address, char addressString)

bindAddress(const NetAddress & address, NetSocket socket, bool useUDP)

closeConnectTo(NetSocket socket)

closePort()

closeSocket(NetSocket socket)

compareAddresses(const NetAddress * a1, const NetAddress * a2)

connect(NetSocket socket, const NetAddress * address)

disableMulticast()

enableMulticast()

getConnectionAcceptedEvent()

getConnectionNotifyEvent()

getConnectionReceiveEvent()

getIdealListenAddress(NetAddress * address)

getListenAddress(const NetAddress::Type type, NetAddress * address, bool forceDefaults)

Gets the desired default listen address for a specified address type.

getPacketReceiveEvent()

getPort()

init()

isAddressTypeAvailable(NetAddress::Type addressType)

isMulticastEnabled()

listen(NetSocket socket, S32 maxConcurrentListens)

openConnectTo(const char * stringAddress)

openListenPort(U16 port, NetAddress::Type )

openPort(S32 connectPort, bool doBind)

openSocket()

recv(NetSocket socket, U8 * buffer, S32 bufferSize, S32 * bytesRead)

send(NetSocket socket, const U8 * buffer, S32 bufferSize, S32 * outBytesWritten)

sendto(const NetAddress * address, const U8 * buffer, S32 bufferSize)

sendtoSocket(NetSocket socket, const U8 * buffer, S32 bufferSize, S32 * bytesWritten)

setBlocking(NetSocket socket, bool blockingIO)

setBroadcast(NetSocket socket, bool broadcastEnable)

setBufferSize(NetSocket socket, S32 bufferSize)

shutdown()

stringToAddress(const char * addressString, NetAddress * address, bool hostLookup, int family)

Private Static Functions

process()

processListenSocket(NetSocket socket)