GizmoDistribution

gzDistRemoteChannel.h File Reference

Definition of remote communication channel. More...

#include "gzDistBase.h"
#include "gzDistRemoteMessage.h"
#include "gzDistEncoder.h"

Go to the source code of this file.

Classes

class  gzDistProtocolMessageHeader
class  gzDistDisposeRemoteMessage
class  gzDistInstanceIDCompareClass
class  gzDistRemoteInstanceIndex
class  gzDistResendRequestItem
class  gzDistRemoteChannel
 Remote distribution communication channel. More...

Enumerations

enum  gzDistTransportType {
  GZ_DIST_MULTICAST,
  GZ_DIST_BROADCAST,
  GZ_DIST_TCP
}
 Transport type used in gzDistCreateDefaultSessionChannel and gzDistCreateDefaultServerChannel. More...

Functions

gzDistRemoteChannelgzDistCreateDefaultServerChannel (gzBool reliable=FALSE, gzDistTransportType transportType=GZ_DIST_MULTICAST, gzDistEncoderInterface *encoder=NULL)
 Create default server channel.
gzDistRemoteChannelgzDistCreateDefaultSessionChannel (gzBool reliable=FALSE, gzDistTransportType transportType=GZ_DIST_MULTICAST, gzDistEncoderInterface *encoder=NULL)
 Create default session channel.
gzDistRemoteChannelgzDistCreateChannel (gzUInt reliableBufferSize, gzDistTransportType transportType, gzDistEncoderInterface *encoder, const gzString &address, gzUInt port, const gzString &iface="0.0.0.0")
 Create a distribution channel.

Variables

const gzUByte GZ_DIST_PROTOCOL_VERSION = 0x14
const gzUShort GZ_DIST_PROTOCOL_HEADER_SIZE = 29
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_VERSION_POS = 0
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_PRIO_POS = 1
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_CHANNEL_POS = 1
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_MESSAGE_TYPE_POS = 2
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_SENDER_PROCESS_ID_POS = 3
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_SENDER_MACHINE_ID_POS = 7
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_SENDER_INDEX_POS = 11
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_FRAGMENT_LENGTH_POS = 15
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_DESTINATION_PROCESS_ID_POS = 17
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_DESTINATION_MACHINE_ID_POS = 21
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_FRAGMENT_INDEX_POS = 25
const gzUByte GZ_DIST_PROTOCOL_MESSAGE_FRAGMENTS_POS = 27


Detailed Description

Definition of remote communication channel.

Definition in file gzDistRemoteChannel.h.


Enumeration Type Documentation

enum gzDistTransportType
 

Transport type used in gzDistCreateDefaultSessionChannel and gzDistCreateDefaultServerChannel.

Enumerator:
GZ_DIST_MULTICAST 
  • Multicast
GZ_DIST_BROADCAST 
  • Broadcast
GZ_DIST_TCP 
  • TCP/IP

Definition at line 60 of file gzDistRemoteChannel.h.


Function Documentation

gzDistRemoteChannel* gzDistCreateDefaultSessionChannel gzBool  reliable = FALSE,
gzDistTransportType  transportType = GZ_DIST_MULTICAST,
gzDistEncoderInterface encoder = NULL
 

Create default session channel.

Create a channel with a default transport installed. The default session transport uses UDP multicast on group GZ_DIST_DEFAULT_IP_ADDRESS and port GZ_DIST_DEFAULT_SESSION_PORT. These constants are defined in gzDistBase.h

Parameters:
reliable Set this to TRUE if a reliable connection is desired. Zero gives best-effort.
transportType Set this to GZ_DIST_BROADCAST to create a broadcast channel. GZ_DIST_MULTICAST (default) will create a multicast channel. It is possible to use a TCP copnnection by seting the parameter to GZ_DIST_TCP. This will create a TCP client. In this case, the gzDistRouter is needed. gzDistRouter is a tool that can be downloaded from the homepage of GizmoSDK.
encoder Use this to add a compressor, crypto etc.
Returns:
A pointer to a gzDistRemoteChannel.
Note:
A reliable mode GizmoDistribution process cannot cooperate with a best-effort mode GizmoDistribution process.
See also:
gzDistRemoteChannel::gzDistRemoteChannel()
gzDistCreateDefaultServerChannel()
gzDistCreateChannel()
Examples:
encoder.cpp, gizmochat.cpp, and main.cpp.

gzDistRemoteChannel* gzDistCreateChannel gzUInt  reliableBufferSize,
gzDistTransportType  transportType,
gzDistEncoderInterface encoder,
const gzString &  address,
gzUInt  port,
const gzString &  iface = "0.0.0.0"
 

Create a distribution channel.

Create a channel with customized parameters.

Parameters:
reliableBufferSize Number of buffered messages for a reliable transfer mode. The default value is 10000 for the session channel and 50 for the server channel. These are also recommended values to use. Smaller values will affect performance but not the reliability. Every post in the reliable buffer will allocate 2 KB. Zero gives best-effort mode.
transportType Set this to GZ_DIST_BROADCAST to create a broadcast channel. GZ_DIST_MULTICAST (default) will create a multicast channel. It is possible to use a TCP copnnection by seting the parameter to GZ_DIST_TCP. This will create a TCP client. In this case, the gzDistRouter is needed. gzDistRouter is a tool that can be downloaded from the homepage of GizmoSDK.
encoder Use this to add a compressor, crypto etc.
address The IP address to use.
port The port to use.
iface The interface address to use, e.g. the IP address of a specific network adapter.
Returns:
A pointer to a gzDistRemoteChannel.
Note:
A reliable mode GizmoDistribution process cannot cooperate with a best-effort mode GizmoDistribution process.
See also:
gzDistRemoteChannel::gzDistRemoteChannel()
gzDistCreateDefaultSessionChannel()
gzDistCreateDefaultServerChannel()


Documentation for GizmoDistribution generated at Wed Feb 20 11:59:21 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond