Introduction Manual Class Reference Header Reference

ZoidCom Class Reference

List of all members.

Detailed Description

Main control class. May be instantiated only once.


Public Member Functions

void setConnectionTimeout (zU32 _timeout)
 Set timeout after which a connection automatically closes.
void setLogLevel (zU8 _level)
 Set Loglevel.
void setResendTimeout (zU32 _timeout)
 Set timeout after which a packet should be resent.

Static Public Member Functions

static zU32 getTime ()
 Get current time.
static void overrideMemoryHandlers (void *(*_allocator)(size_t _size), void(*_deallocator)(void *_ptr))
 Set custom memory handling functions.
static void Sleep (zU32 _msecs)
 Let process sleep.


Member Function Documentation

void ZoidCom::setConnectionTimeout zU32  _timeout  ) 
 

Set timeout after which a connection automatically closes.

Parameters:
_timeout Value in msecs.
A connection will close after not receiving anything from the peer for _timeout msecs.

Default is 20 seconds.

void ZoidCom::setResendTimeout zU32  _timeout  ) 
 

Set timeout after which a packet should be resent.

Parameters:
_timeout Value in msecs.
If Zoidcom is waiting for too many packet acks it won't send any more packets until such an ack arrives. When this timeout passes, Zoidcom will resend the oldest unacked packet. This timeout should be lower than the setConnectionTimeout(), enabling Zoidcom to resend connection requests several times before giving up.

Default is 4 seconds.

static void ZoidCom::overrideMemoryHandlers void *(*)(size_t _size)  _allocator,
void(*)(void *_ptr)  _deallocator
[static]
 

Set custom memory handling functions.

Parameters:
_allocator Pointer to a function which allocates memory blocks of size _size and returns a pointer to them.
_deallocator Pointer to a function which takes a memory pointer _ptr and deallocates it.
Set NULL on one or both parameters to default back to malloc() and/or free(). You should call this method before instantiating the ZoidCom object.

You should also make sure, that, when your application exits, all allocated ZCom_* objects are deleted again.

void ZoidCom::setLogLevel zU8  _level  ) 
 

Set Loglevel.

Parameters:
_level 0 = only warnings & errors, 1 = informative, 2 = verbose
Default is 1.

static zU32 ZoidCom::getTime  )  [static]
 

Get current time.

Returns:
A time value in milliseconds.
This value is used internally for determining timeouts and computing extrapolations

static void ZoidCom::Sleep zU32  _msecs  )  [static]
 

Let process sleep.

Parameters:
_msecs Amount of milliseconds the process should sleep. 0 will just give up our timeslice, so we are nice to other processes.


This file is part of the documentation for Zoidcom. Documentation copyright © 2004-2008 by Jörg Rüppel. Generated on Sat Aug 16 15:26:51 2008 for Zoidcom by doxygen 1.4.6-NO