PSI sics-cvs-psi_pre-ansto
This commit is contained in:
74
udpquieck.w
Normal file
74
udpquieck.w
Normal file
@@ -0,0 +1,74 @@
|
||||
\subsection{UDPquieck}
|
||||
At SinQ a requirement is that newly created data files are automatically
|
||||
copied to another computer. This is for data safety. To have this done by
|
||||
the instrument control program would raise stability problems: what to do
|
||||
when the remote computer fails, when transfers are to slow or all data has
|
||||
to be transferred again. Therefore the copying of files was delegated to a
|
||||
second process. Now a a means is needed to tell the second process, that a
|
||||
new data file has been created. This means is this module. It sends a UDP
|
||||
message on a predefined port. The data copying process can receive or not
|
||||
and act accordingly. Furthermore this scheme can be used to have other
|
||||
processes act upon a new data file as well. The message sent is simple: it
|
||||
consists of the string QUIECK/ followed by the filename. A new command is
|
||||
implemented with the name udpquieck. This shall be a hidden command. As only
|
||||
one such facility is needed for a given SICS server, all necessary data is
|
||||
held in the implementation file udpquieck.c. Anyway, there is only one
|
||||
structure holding network data.
|
||||
The configuration of the udpport is done via a special server
|
||||
option QuieckPort.
|
||||
|
||||
Laater on this facility may be extended to send arbitrary messages to
|
||||
the UDP port for further coordination tasks. This is catered for by
|
||||
having different message types. However, as of now only file messages
|
||||
are supported.
|
||||
|
||||
Needless to say, that the second process must be able to interpret the
|
||||
uDP messages sent by the SICS server.
|
||||
|
||||
|
||||
|
||||
The following interface is implemented:
|
||||
|
||||
@d quieck @{
|
||||
|
||||
#define QUIECK 1
|
||||
|
||||
void KillQuieck(void *pData);
|
||||
|
||||
int SendQuieck(int iType, char *filename);
|
||||
|
||||
int QuieckAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
int argc, char *argv[]);
|
||||
|
||||
@}
|
||||
|
||||
@o udpquieck.h @{
|
||||
/*------------------------------------------------------------------------
|
||||
U D P Q U I E C K
|
||||
|
||||
udpquieck sends a notification message on a UDP port when a new data
|
||||
file has been created.
|
||||
|
||||
Mark Koennecke, August 1998
|
||||
---------------------------------------------------------------------------*/
|
||||
#ifndef UDPQUIECK
|
||||
#define UDPQUIECK
|
||||
@<quieck@>
|
||||
#endif
|
||||
@}
|
||||
|
||||
The functions:
|
||||
\begin{description}
|
||||
\item[KillQuieck] closes the network port at shutdown. Is the
|
||||
KillFunction used in the SICS interpreter command structure.
|
||||
\item[SendQuieck] sends a message of type iType and the text filename
|
||||
to the UDP port. The only supported iType value is QUIECK as defined
|
||||
in udpquieck.h. Further message types can be supported by adding more
|
||||
support in this function.
|
||||
\item[QuieckAction] is the interpreter interface function to this
|
||||
facility. Yes, messages may be issued by a commadn from the
|
||||
interpreter for instance within scripts. Again, this seems more useful
|
||||
when this facility has been extended.
|
||||
\end{description}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user