INFO: The new Git default branch name is "main". Details here: https://about.gitlab.com/blog/2021/03/10/new-git-default-branch-name/

Commit 2ea93e36 authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

Minor changes


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@427 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent 7a23592c
......@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it
*
* $Id: nmxp.h,v 1.41 2007-10-07 18:13:39 mtheo Exp $
* $Id: nmxp.h,v 1.42 2007-10-07 19:22:29 mtheo Exp $
*
*/
......@@ -616,7 +616,9 @@ PDS arguments:
>0 is for specified sample rate and decompressed data.
-b, --buffered Request also recent packets into the past.
-M, --maxlatency=SECs Max tolerable latency (default 600) [60..600].
Usable only with Raw Stream --stc=-1.
-T, --timeoutrecv=SECs Time-out receiving packets (default 0. No time-out) [10..300].
-T is useful for retrieving Data On Demand.
-M, -T are usable only with Raw Stream --stc=-1.
Matteo Quintiliani - Istituto Nazionale di Geofisica e Vulcanologia - Italy
Mail bug reports and suggestions to <quintiliani@ingv.it>.
......@@ -811,6 +813,10 @@ Mail bug reports and suggestions to <quintiliani@ingv.it>.
* gestione &egrave; -M che serve a specificare la massima latenza tollerabile
* nell'attesa di un pacchetto mancante. Di conseguenza da tale opzione
* dipende la grandezza del buffer.
*
* Alternativamente, o in aggiunta all'opzione -M si pu&ograve; utilizzare l'opzione -T
* che specifica per ogni canale il tempo massimo tollerabile fra la ricezione
* di un pacchetto e il successivo.
*
* Quando si interagisce con il NaqsServer si pu&ograve; anche utilizzare
* l'opzione -b, la quale permette di ricevere anche alcuni dati, in
......@@ -1024,7 +1030,7 @@ typedef struct {
int32_t last_seq_no_sent;
double last_sample_time;
int32_t max_pdlist_items;
double max_tollerable_latency;
double max_tolerable_latency;
int timeoutrecv;
int32_t n_pdlist;
NMXP_DATA_PROCESS **pdlist; /* Array for pd queue */
......@@ -1090,6 +1096,8 @@ int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST_NET *channelList, in
* \param isock A descriptor referencing the socket.
* \param channelList Channel list.
* \param network_code Network code. It can be NULL.
* \param timeoutsec Time-out in seconds
* \param[out] recv_errno errno value after recv()
*
* \retval Pointer to the structure NMXP_DATA_PROCESS on success
* \retval NULL on error
......@@ -1189,11 +1197,11 @@ int nmxp_raw_stream_seq_no_compare(const void *a, const void *b);
/*! \brief Allocate and initialize fields inside a NMXP_RAW_STREAM_DATA structure
*
* \param raw_stream_buffer pointer to NMXP_RAW_STREAM_DATA struct to initialize
* \param max_pdlist_items value of max number of items in array
* \param max_tolerable_latency Max tolerable latency
* \param timeoutrecv value of time-out within receving packets
*
*/
void nmxp_raw_stream_init(NMXP_RAW_STREAM_DATA *raw_stream_buffer, int32_t max_tollerable_latency, int timeoutrecv);
void nmxp_raw_stream_init(NMXP_RAW_STREAM_DATA *raw_stream_buffer, int32_t max_tolerable_latency, int timeoutrecv);
/*! \brief Free fields inside a NMXP_RAW_STREAM_DATA structure
......
......@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it
*
* $Id: nmxp_base.h,v 1.24 2007-10-07 18:13:39 mtheo Exp $
* $Id: nmxp_base.h,v 1.25 2007-10-07 19:22:29 mtheo Exp $
*
*/
......@@ -70,7 +70,7 @@ int nmxp_send_ctrl(int isock, void *buffer, int length);
* \param[out] buffer Data buffer.
* \param length Length in bytes.
* \param timeoutsec Time-out in seconds
* \param[out] errno errno value after recv()
* \param[out] recv_errno errno value after recv()
*
* \warning Data buffer it has to be allocated before and big enough to contain length bytes!
*
......@@ -99,12 +99,14 @@ int nmxp_sendHeader(int isock, NMXP_MSG_CLIENT type, int32_t length);
* \param isock A descriptor referencing the socket.
* \param[out] type Type of message within \ref NMXP_MSG_CLIENT.
* \param[out] length Length in bytes.
* \param timeoutsec Time-out in seconds
* \param[out] recv_errno errno value after recv()
*
* \retval NMXP_SOCKET_OK on success
* \retval NMXP_SOCKET_ERROR on error
*
*/
int nmxp_receiveHeader(int isock, NMXP_MSG_SERVER *type, int32_t *lengthi, int timeoutsec, int *recv_errno );
int nmxp_receiveHeader(int isock, NMXP_MSG_SERVER *type, int32_t *length, int timeoutsec, int *recv_errno );
/*! \brief Sends header and body of a message.
......@@ -127,6 +129,8 @@ int nmxp_sendMessage(int isock, NMXP_MSG_CLIENT type, void *buffer, int32_t leng
* \param[out] type Type of message within \ref NMXP_MSG_SERVER.
* \param[out] buffer Data buffer. It will need to be freed!
* \param[out] length Length in bytes.
* \param timeoutsec Time-out in seconds
* \param[out] recv_errno errno value after recv()
*
* \warning buffer will need to be freed!
*
......
......@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it
*
* $Id: nmxp.c,v 1.50 2007-10-07 18:13:39 mtheo Exp $
* $Id: nmxp.c,v 1.51 2007-10-07 19:22:29 mtheo Exp $
*
*/
......@@ -512,15 +512,15 @@ int nmxp_raw_stream_seq_no_compare(const void *a, const void *b)
return ret;
}
void nmxp_raw_stream_init(NMXP_RAW_STREAM_DATA *raw_stream_buffer, int32_t max_tollerable_latency, int timeoutrecv) {
void nmxp_raw_stream_init(NMXP_RAW_STREAM_DATA *raw_stream_buffer, int32_t max_tolerable_latency, int timeoutrecv) {
int j;
raw_stream_buffer->last_seq_no_sent = -1;
raw_stream_buffer->last_sample_time = -1.0;
/* TODO
* Suppose a packet can contain 1/4 secs of data */
raw_stream_buffer->max_tollerable_latency = max_tollerable_latency;
raw_stream_buffer->max_pdlist_items = max_tollerable_latency * 4;
raw_stream_buffer->max_tolerable_latency = max_tolerable_latency;
raw_stream_buffer->max_pdlist_items = max_tolerable_latency * 4;
raw_stream_buffer->timeoutrecv = timeoutrecv;
raw_stream_buffer->n_pdlist = 0;
raw_stream_buffer->pdlist = (NMXP_DATA_PROCESS **) malloc (raw_stream_buffer->max_pdlist_items * sizeof(NMXP_DATA_PROCESS *));
......@@ -597,7 +597,7 @@ int nmxp_raw_stream_manage(NMXP_RAW_STREAM_DATA *p, NMXP_DATA_PROCESS *a_pd, int
/* Add pd and sort array */
if(p->n_pdlist >= p->max_pdlist_items
|| latency >= p->max_tollerable_latency) {
|| latency >= p->max_tolerable_latency) {
/* Supposing p->pdlist is ordered,
* handle the first item and over write it.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment