Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Static Public Member Functions | List of all members
Net Struct Reference

`#include <platformNetwork.h>`

## Public Types
enum | Error { NoError, WrongProtocolType, InvalidPacketProtocol, WouldBlock, NotASocket, UnknownError }
enum | Protocol { UDPProtocol, IPXProtocol, TCPProtocol }

## Static Public Member Functions
static bool | init ()
static void | shutdown ()
static void | process ()
static bool | openPort (S32 connectPort)
static void | closePort ()
static Error | sendto (const NetAddress *address, const U8 *buffer, S32 bufferSize)
static NetSocket | openListenPort (U16 port)
static NetSocket | openConnectTo (const char *stringAddress)
static void | closeConnectTo (NetSocket socket)
static Error | sendtoSocket (NetSocket socket, const U8 *buffer, S32 bufferSize)
static bool | compareAddresses (const NetAddress *a1, const NetAddress *a2)
static bool | stringToAddress (const char *addressString, NetAddress *address)
static void | addressToString (const NetAddress *address, char addressString[256])
static NetSocket | openSocket ()
static Error | closeSocket (NetSocket socket)
static Error | connect (NetSocket socket, const NetAddress *address)
static Error | listen (NetSocket socket, S32 maxConcurrentListens)
static NetSocket | accept (NetSocket acceptSocket, NetAddress *remoteAddress)
static Error | bind (NetSocket socket, U16 port)
static Error | setBufferSize (NetSocket socket, S32 bufferSize)
static Error | setBroadcast (NetSocket socket, bool broadcastEnable)
static Error | setBlocking (NetSocket socket, bool blockingIO)
static Error | send (NetSocket socket, const U8 *buffer, S32 bufferSize)
static Error | recv (NetSocket socket, U8 *buffer, S32 bufferSize, S32 *bytesRead)

## Member Enumeration Documentation

enum Error

Enumerator
NoError |
WrongProtocolType |
InvalidPacketProtocol |
WouldBlock |
NotASocket |
UnknownError |

enum Protocol

Enumerator
UDPProtocol |
IPXProtocol |
TCPProtocol |

## Member Function Documentation

NetSocket accept | ( | NetSocket | acceptSocket,
|  | NetAddress * | remoteAddress
| ) |  |
| static

void addressToString | ( | const NetAddress * | address,
|  | char | addressString[256]
| ) |  |
| static

Net::Error bind | ( | NetSocket | socket,
|  | U16 | port
| ) |  |
| static

void closeConnectTo | ( | NetSocket | socket | ) |
| static

void closePort | ( |  | ) |
| static

Net::Error closeSocket | ( | NetSocket | socket | ) |
| static

bool compareAddresses | ( | const NetAddress * | a1,
|  | const NetAddress * | a2
| ) |  |
| static

Net::Error connect | ( | NetSocket | socket,
|  | const NetAddress * | address
| ) |  |
| static

bool init | ( |  | ) |
| static

Net::Error listen | ( | NetSocket | socket,
|  | S32 | maxConcurrentListens
| ) |  |
| static

NetSocket openConnectTo | ( | const char * | stringAddress | ) |
| static

NetSocket openListenPort | ( | U16 | port | ) |
| static

bool openPort | ( | S32 | connectPort | ) |
| static

NetSocket openSocket | ( |  | ) |
| static

void process | ( |  | ) |
| static

Net::Error recv | ( | NetSocket | socket,
|  | U8 * | buffer,
|  | S32 | bufferSize,
|  | S32 * | bytesRead
| ) |  |
| static

Net::Error send | ( | NetSocket | socket,
|  | const U8 * | buffer,
|  | S32 | bufferSize
| ) |  |
| static

Net::Error sendto | ( | const NetAddress * | address,
|  | const U8 * | buffer,
|  | S32 | bufferSize
| ) |  |
| static

Net::Error sendtoSocket | ( | NetSocket | socket,
|  | const U8 * | buffer,
|  | S32 | bufferSize
| ) |  |
| static

Net::Error setBlocking | ( | NetSocket | socket,
|  | bool | blockingIO
| ) |  |
| static

Net::Error setBroadcast | ( | NetSocket | socket,
|  | bool | broadcastEnable
| ) |  |
| static

Net::Error setBufferSize | ( | NetSocket | socket,
|  | S32 | bufferSize
| ) |  |
| static

void shutdown | ( |  | ) |
| static

bool stringToAddress | ( | const char * | addressString,
|  | NetAddress * | address
| ) |  |
| static

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

- platform/platformNetwork.h
- platformAndroid/AndroidNet.cpp
- platformEmscripten/EmscriptenNet.cpp