Main Page   Compound List   File List   Compound Members   File Members  

lib/gobj/comm.h File Reference

Communication manager. More...

#include <gobjconfig.h>
#include <gobj/context.h>
#include <gobj/id.h>
#include <gobj/stream.h>

Functions

Gj_CommParamGj_commparam_new ()
 Create a new communication parameter structure.

void Gj_commparam_delete (Gj_CommParam* param)
 @biref Delete a communication parameter structure.

Gj_CommGj_comm_new (Gj_Ctx* ctx, Gj_Id* iface, char* address, Gj_CommParam* param)
 Create a new communication structure. More...

Gj_CommGj_comm_newFromStream (Gj_Ctx* ctx, Gj_Stream* stream, Gj_CommParam* param)
 Create a new communication structure (server-side) from a stream. More...

int Gj_comm_delete (Gj_Ctx* ctx, Gj_Comm* comm)
 Delete a communication structure. More...

int Gj_comm_processCommand (Gj_Ctx* ctx, Gj_Comm* comm, Gj_Bool* abort)
 Wait for a command and process it. More...

int Gj_comm_end (Gj_Ctx* ctx, Gj_Comm* comm)
 End a communication. More...

int gj_comm_end_serve (Gj_Ctx* ctx, Gj_Comm* comm)
 Serve an 'Gj_comm_end' command. More...

int Gj_comm_getSysid (Gj_Ctx* ctx, Gj_Comm* comm, Gj_Sysid* sysid)
 Get the sysid of the remote system. More...

int gj_comm_getSysid_serve (Gj_Ctx* ctx, Gj_Comm* comm)
 Serve an 'Gj_comm_getSysid' command. More...


Detailed Description

Communication manager.


Function Documentation

Gj_Comm * Gj_comm_new ( Gj_Ctx * ctx,
Gj_Id * iface,
char * address,
Gj_CommParam * param )
 

Create a new communication structure.

If param is 0 a default parameter structure is used. The communication overtakes THE OWNERSHIP of param. address and iface are DUPLICATED.

Returns:
A pointer to the new communication structure on success, 0 otherwise.

Gj_Comm * Gj_comm_newFromStream ( Gj_Ctx * ctx,
Gj_Stream * stream,
Gj_CommParam * param )
 

Create a new communication structure (server-side) from a stream.

The possession of the stream is overtaken by the communication structure (i.e. it p.e. is being deleted if an error occurs in this function). If param is 0 a default parameter structure is used. param is NOT DUPLICATED.

Returns:
A pointer to the new communication structure on success, 0 otherwise.

int Gj_comm_delete ( Gj_Ctx * ctx,
Gj_Comm * comm )
 

Delete a communication structure.

Returns:
0 on success, -1 otherwise.

int Gj_comm_processCommand ( Gj_Ctx * ctx,
Gj_Comm * comm,
Gj_Bool * abort )
 

Wait for a command and process it.

Returns:
0 on success, -1 otherwise.

int Gj_comm_end ( Gj_Ctx * ctx,
Gj_Comm * comm )
 

End a communication.

Returns:
0 on success, -1 otherwise.

int gj_comm_end_serve ( Gj_Ctx * ctx,
Gj_Comm * comm )
 

Serve an 'Gj_comm_end' command.

Returns:
0 on success, -1 otherwise.

For internal use only.

int Gj_comm_getSysid ( Gj_Ctx * ctx,
Gj_Comm * comm,
Gj_Sysid * sysid )
 

Get the sysid of the remote system.

Returns:
0 on success, -1 otherwise.

int gj_comm_getSysid_serve ( Gj_Ctx * ctx,
Gj_Comm * comm )
 

Serve an 'Gj_comm_getSysid' command.

Returns:
0 on success, -1 otherwise.

For internal use only.


Generated at Fri Aug 17 18:28:56 2001 for Gobj by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000