- allow scriptcontext objects to be dynamic
- enhancements in scriptcontext (error messages stored as properties)
This commit is contained in:
14
ascon.i
14
ascon.i
@ -12,7 +12,7 @@
|
||||
* For the implementation of a custom protocol, you have to implement
|
||||
* the handler function and the init function, declare the protocol
|
||||
* of type AsconProtocol and call AsconInsertProtocol on startup.
|
||||
* The handler and init functions are normally be a wrapper around AsconStdHandler
|
||||
* The handler and init functions are normally a wrapper around AsconStdHandler
|
||||
* and AsconStdInit
|
||||
*
|
||||
* The functions with fd as the first argument are utility functions with
|
||||
@ -64,8 +64,9 @@ struct Ascon {
|
||||
int wrPos; /**< write buffer position */
|
||||
double timeout; /**< read timeout (sec) */
|
||||
char *sendTerminator; /**< terminator for sending messages */
|
||||
char *replyTerminator; /**< terminator list for reply. NULL is the special case CR, LF or CR/LF */
|
||||
char *hostport; /**< host:port to connect */
|
||||
ErrMsg *errList; /**< error message list */
|
||||
pDynString errmsg; /**< error message */
|
||||
double start; /**< unix time when read was started */
|
||||
void *private; /**< private data of protocol */
|
||||
void (*killPrivate)(void *); /** < kill function for private */
|
||||
@ -73,7 +74,6 @@ struct Ascon {
|
||||
int responseValid; /**< a valid response is ready */
|
||||
AsconHandler handler; /**< handler function */
|
||||
double reconnectInterval; /**< reconnect interval */
|
||||
double lastReconnect; /**< last connect try */
|
||||
};
|
||||
|
||||
#define ASCON_SELECT_ERROR -1
|
||||
@ -92,7 +92,13 @@ int AsconStdHandler(Ascon *a);
|
||||
/** \brief initialize a standard connection
|
||||
* \param a the connection
|
||||
* \param con A connection to print errors too.
|
||||
* \param hostport the tcp/ip address (syntax: host:port)
|
||||
* \param argc number of arguments
|
||||
* \param argv arguments ("<host>:<port>" [sendTerminator] [timeout] [replyTerminators])
|
||||
* sendTerminator is a character or string sent at the end of a command
|
||||
* timoeut is in seconds
|
||||
* replyTerminator is a string, meant as a list of terminator characters
|
||||
* if not replyTerminator is given, CR, LF or CR/LF all are detected as
|
||||
* terminators
|
||||
*
|
||||
* In most cases a custom init function may be a wrapper around AsconStdInit
|
||||
*/
|
||||
|
Reference in New Issue
Block a user