GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > NMSG / V2-0-1

Constituent: nmsg_ux     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

nmsgLib.h File Reference

Definitions for the network message routines. More...

#include "vxWorks.h"

Include dependency graph for nmsgLib.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Data Structures

struct  nmsgBuff_s
 Prototype message buffer. More...

struct  nmsgHead_s
 Network message header. More...


Typedefs

typedef nmsgHead_s nmsgHead_t
 Network message header.

typedef nmsgBuff_s nmsgBuff_t
 Prototype message buffer.


Functions

STATUS nmsgConnect (void **hndl, char *node, int port)
 Connect to a message server.

STATUS nmsgConnectAsy (void **hndl, char *node, int port, int(*connRtn)(void *hndl, void **uParm), int(*discRtn)(void *hndl, void **uParm), void *uParm)
 Connect asynchronously (robustly) to a message server.

STATUS nmsgListen (void **hndl, int port, int maxConn, int maxData, int(*connRtn)(void *hndl, void **uParm), int(*discRtn)(void *hndl, void **uParm), int(*rcveRtn)(void *hndl, void **uParm, nmsgBuff_t *msg), void *uParm)
 Establish a message server.

STATUS nmsgClose (void *hndl, int force)
 Terminate a message client or server.

STATUS nmsgSendW (void *hndl, nmsgBuff_t *msg, nmsgBuff_t *reply, int maxData)
 Send a message and receive reply.

STATUS nmsgSend (void *hndl, nmsgBuff_t *msg)
 Send a message and return immediately.

STATUS nmsgWait (void *hndl, nmsgBuff_t *reply, int maxData)
 Wait for a reply to a sent message.

int nmsgRemoteIP (void *hndl)
 Get the IP address of the remote end.

int nmsgCheck (void *hndl)
 Check a network connection handle.


Detailed Description

Definitions for the network message routines.

Author:
Owen H Saxton
Id
nmsgLib.h,v 1.4 2004/12/08 23:47:10 saxton Exp

Function Documentation

int nmsgCheck void *  hndl  ) 
 

Check a network connection handle.

This routine checks whether a network handle is valid or not.

Parameters:
hndl The handle for the connection.
Return values:
TRUE The handle is valid.
FALSE The handle is invalid.

STATUS nmsgClose void *  hndl,
int  force
 

Terminate a message client or server.

This routine closes a network connection or stops a network server.

Parameters:
hndl The handle of the connection or server.
force Not used.
Return values:
OK Success.
ERROR An error occurred.

STATUS nmsgConnect void **  hndl,
char *  node,
int  port
 

Connect to a message server.

This routine establishes a network connection to a message server.

Parameters:
hndl The address of a pointer to receive the identifying handle for the network connection.
node The address of the name of the node containing the message server.
port The port number on which to establish the connection.
Return values:
OK The connection was established successfully.
ERROR An error occurred.

STATUS nmsgConnectAsy void **  hndl,
char *  node,
int  port,
int(*  connRtn)(void *hndl, void **uParm),
int(*  discRtn)(void *hndl, void **uParm),
void *  uParm
 

Connect asynchronously (robustly) to a message server.

This routine establishes a robust network connection to a message server. The connection is done asynchronously, and the attempt is retried periodically if the initial attempt fails, or if the connection is broken.

Parameters:
hndl The address of a pointer to receive the identifying handle for the network connection.
node The address of the name of the node containing the message server.
port The port number on which to establish the connection.
connRtn The address of a routine to be called when the connection has been made.
discRtn The address of a routine to be called when the connection is broken.
uParm A parameter to be passed to the connect and disconnect callback routines.
Return values:
OK The connection process was started successfully.
ERROR An error occurred.

STATUS nmsgListen void **  hndl,
int  port,
int  maxConn,
int  maxData,
int(*  connRtn)(void *hndl, void **uParm),
int(*  discRtn)(void *hndl, void **uParm),
int(*  rcveRtn)(void *hndl, void **uParm, nmsgBuff_t *msg),
void *  uParm
 

Establish a message server.

This routine establishes a network message server (listener).

Parameters:
hndl The address of a pointer to receive the identifying handle for the network listener.
port The port number on which to establish the server.
maxConn The maximum number of concurrent connections that the server will allow.
maxData The maximum number of data bytes that can be transferred in a single message.
connRtn The address of a routine to be called when a new connection has been made. The connection will be rejected if this routine returns ERROR status.
discRtn The address of a routine to be called when a connection is broken.
rcveRtn The address of a routine to be called whenever a message is received.
uParm A parameter to be passed to the connect, disconnect and receive callback routines.
Return values:
OK The message server was started successfully.
ERROR An error occurred.

int nmsgRemoteIP void *  hndl  ) 
 

Get the IP address of the remote end.

This routine returns the IP address of the remote end of a connection. It can be used on either end of a connection.

Parameters:
hndl The handle for the connection.
Returns:
The IP address of the remote end of the connection.

STATUS nmsgSend void *  hndl,
nmsgBuff_t msg
 

Send a message and return immediately.

This routine sends a message on a network connection and returns without waiting for a reply.

Parameters:
hndl The handle for the connection.
msg The address of message to be sent. It must be formatted using the nmsgBuff_t structure type.
Return values:
OK Success.
ERROR An error occurred.

STATUS nmsgSendW void *  hndl,
nmsgBuff_t msg,
nmsgBuff_t reply,
int  maxData
 

Send a message and receive reply.

This routine sends a message on a network connection and waits for a reply.

Parameters:
hndl The handle for the connection.
msg The address of message to be sent. It must be formatted using the nmsgBuff_t structure type.
reply The address of an area to receive the reply to the message. It will be formatted using the nmsgBuff_t structure type.
maxData The maximum number of data bytes that can be put into the reply.
Return values:
OK Success.
ERROR An error occurred.

STATUS nmsgWait void *  hndl,
nmsgBuff_t reply,
int  maxData
 

Wait for a reply to a sent message.

This routine waits for a reply to a previously sent message.

Parameters:
hndl The handle for the connection.
reply The address of an area to receive the reply to the message. It will be formatted using the nmsgBuff_t structure type.
maxData The maximum number of data bytes that can be put into the reply.
Return values:
OK Success.
ERROR An error occurred.


Generated on Tue Jan 4 02:43:35 2005 by doxygen 1.3.3