13.5 Socket-Based Data Feeds 13.5.1 Overview For true data feeds, wvalarmd provides a socket server which listens on port 11011 of the wview server for connections. When a datafeed client connects on that port, wvalarmd adds the client to the datafeed client list. Then when loop data is received from wviewd, wvalarmd will write the loop packet into each datafeed client's socket, preceded by a start frame sequence. It is a one-way interface and the client may disconnect at any time by calling "shutdown" followed by "close" to close the socket. The number of active client connections is only limited by system resources. The datafeed client will receive the full loop packet as defined in common/datadefs.h - see the structure "LOOP_PKT". 13.5.2 Configuration None required for socket data feeds, just the normal PUSH_INTERVAL setup described above. No alarm entries are required in wvalarm.conf for datafeed clients. 13.5.2 Client Requirements The datafeed sockets are regular TCP/stream PF_INET sockets. The general connection steps (in C) are as follows: socket (...) // create the socket descriptor [setup server address and port in socckaddr_in structure] connect (...) The client then may add the socket descriptor to an fdset for select calls, simply block on the socket for reads, however you want to design it. Other programming language procedures may differ, but the general approach should be the same. Normal Processing "Loop": 1) Wait for data on the socket 2) Sync to the start frame sequence: 0xF388, 0xC6A2, 0xDADA, 0xE7CF 3) Read loop packet 4) Process loop packet 5) Goto #1 To disconnect: shutdown (sockfd, 2) close (sockfd) Note: There is a handy new radlib socket API which is illustrated in the sample datafeed client source code which takes care of most of the