Main Page   Compound List   File List   Compound Members   File Members  

lib/comm.c File Reference

Communication manager. More...

#include "gobj/comm.h"
#include "gobj/ids.h"
#include "gobj/errors.h"
#include "gobj/utils.h"

Compounds

struct  Gj_CommParam_struct
struct  Gj_Comm_struct

Typedefs

typedef enum gj_CommMode_enum  gj_CommMode
 Communction mode enum. More...

typedef enum gj_CommandNum_enum  gj_CommandNum
 Command numbers for GJ_COMMMODE_NORMAL, proto ID_COMMMODENORMALPROTO_STD. More...


Enumerations

enum  gj_CommMode_enum {
  GJ_COMMMODE_NORMAL
}
 Communction mode enum. More...

enum  gj_CommandNum_enum {
  GJ_COMMANDNUM_NONE = 0,
  GJ_COMMANDNUM_END = 1,
  GJ_COMMANDNUM_GETSYSID
}
 Command numbers for GJ_COMMMODE_NORMAL, proto ID_COMMMODENORMALPROTO_STD. More...


Functions

int gj_comm_clientHandshake (Gj_Ctx* ctx, Gj_Comm* comm)
 Do the client-side hand-shake. More...

int gj_comm_serverHandshake (Gj_Ctx* ctx, Gj_Comm* comm)
 Do the server-side hand-shake. More...

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

Gj_CommGj_comm_newFormStream (Gj_Ctx* ctx, Gj_Stream* stream, Gj_CommParam* param)
int Gj_comm_delete (Gj_Ctx* ctx, Gj_Comm* comm)
 Delete a communication structure. More...

int gj_comm_sendCommand (Gj_Ctx* ctx, Gj_Comm* comm, gj_CommandNum command)
 Send a command. More...

gj_CommandNum gj_comm_recvCommand (Gj_Ctx* ctx, Gj_Comm* comm)
 Receive a command. 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...


Variables

char gj_CommandNames [][50]
 Command names for GJ_COMMMODE_NORMAL, proto ID_COMMANDNORMALPROTO_STD. More...


Detailed Description

Communication manager.


Typedef Documentation

typedef enum gj_CommMode_enum gj_CommMode
 

Communction mode enum.

For internal use only.

typedef enum gj_CommandNum_enum gj_CommandNum
 

Command numbers for GJ_COMMMODE_NORMAL, proto ID_COMMMODENORMALPROTO_STD.

For internal use only.


Enumeration Type Documentation

enum gj_CommMode_enum
 

Communction mode enum.

For internal use only.

enum gj_CommandNum_enum
 

Command numbers for GJ_COMMMODE_NORMAL, proto ID_COMMMODENORMALPROTO_STD.

For internal use only.


Function Documentation

int gj_comm_clientHandshake ( Gj_Ctx * ctx,
Gj_Comm * comm )
 

Do the client-side hand-shake.

Returns:
0 on success, -1 otherwise.

int gj_comm_serverHandshake ( Gj_Ctx * ctx,
Gj_Comm * comm )
 

Do the server-side hand-shake.

Returns:
0 on success, -1 otherwise.

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.

int Gj_comm_delete ( Gj_Ctx * ctx,
Gj_Comm * comm )
 

Delete a communication structure.

Returns:
0 on success, -1 otherwise.

int gj_comm_sendCommand ( Gj_Ctx * ctx,
Gj_Comm * comm,
gj_CommandNum command )
 

Send a command.

For internal use only.

gj_CommandNum gj_comm_recvCommand ( Gj_Ctx * ctx,
Gj_Comm * comm )
 

Receive a command.

Returns:
The command number on success, 0 otherwise.

For internal use only.

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.


Variable Documentation

char gj_CommandNames[][50]
 

Initializer:

{
  "none",
  "end",
  "getSysid"
}
Command names for GJ_COMMMODE_NORMAL, proto ID_COMMANDNORMALPROTO_STD.

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