GizmoDistribution

gzDistTransportUDP Class Reference

UDP transport class. More...

#include <gzDistTransport.h>

Inheritance diagram for gzDistTransportUDP:

gzDistTransportInterface List of all members.

Public Member Functions

 gzDistTransportUDP (gzULong sendBuffer=GZ_DIST_DEFAULT_SEND_SOCKET_BUFFER, gzULong recvBuffer=GZ_DIST_DEFAULT_RECV_SOCKET_BUFFER)
 Constructor.
virtual ~gzDistTransportUDP ()
 Destructor.
gzBool createUnicast (const gzHostAddress &destAddress, gzUShort port, const gzHostAddress &interfaceAddress=gzHostAddress())
 Setup UDP unicast.
gzBool createMulticast (const gzSocketAddress &multicastAddress, const gzHostAddress &interfaceAddress=gzHostAddress())
 Setup UDP multicast.
gzBool createBroadcast (gzUShort port, const gzHostAddress &interfaceAddress=gzHostAddress())
 Setup UDP broadcast.
gzBool open ()
 Open transport.
gzVoid close ()
 Close transport.
gzBool isOpen () const
 Check if transport is open.
gzBool isConnected ()
 Check if transport is connected.
gzBool send (const gzUByte *buffer, gzULong length)
 Send message.
gzInt receive (gzUByte *buffer, gzULong length, gzULong timeout=0)
 Receive message.

Detailed Description

UDP transport class.

Transport using UDP/IP. Supports unicast, multicast and broadcast. Multicast and broadcast are the common transports for local area networks.

See also:
gzDistTransportInterface
Examples:

server.cpp.

Definition at line 112 of file gzDistTransport.h.


Constructor & Destructor Documentation

gzDistTransportUDP::gzDistTransportUDP gzULong  sendBuffer = GZ_DIST_DEFAULT_SEND_SOCKET_BUFFER,
gzULong  recvBuffer = GZ_DIST_DEFAULT_RECV_SOCKET_BUFFER
[explicit]
 

Constructor.

Note:
The max allowed socket buffer size may be different on different platforms.
Parameters:
sendBuffer Size of the socket send buffer.
recvBuffer Size of the socket receive buffer.


Member Function Documentation

gzBool gzDistTransportUDP::createUnicast const gzHostAddress &  destAddress,
gzUShort  port,
const gzHostAddress &  interfaceAddress = gzHostAddress()
 

Setup UDP unicast.

Parameters:
destAddress Destination address.
port Destination and receive port.
interfaceAddress Address of the network interface adapter to bind to. The default value lets the system select interface.

gzBool gzDistTransportUDP::createMulticast const gzSocketAddress &  multicastAddress,
const gzHostAddress &  interfaceAddress = gzHostAddress()
 

Setup UDP multicast.

Parameters:
multicastAddress Multicast group address and port number to send to and receive from. Valid Adresses are in the range from 224.0.0.0 to 239.255.255.255.
interfaceAddress Address of the network interface adapter to bind to. The default value lets the system select interface.
Examples:
server.cpp.

gzBool gzDistTransportUDP::createBroadcast gzUShort  port,
const gzHostAddress &  interfaceAddress = gzHostAddress()
 

Setup UDP broadcast.

Parameters:
port Port number to send to an reeceive from.
interfaceAddress Address of the network interface adapter to bind to. The default value lets the system select interface.


The documentation for this class was generated from the following file:
Documentation for GizmoDistribution generated at Wed Feb 20 11:59:22 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond