Subscribing
PPS clients can subscribe to multiple objects, and PPS objects can have multiple subscribers. When a publisher changes an object, all clients subscribed to that object are informed of the change.
To subscribe to an object, a client simply calls open() for the object with O_RDONLY to subscribe only, or O_RDWR to publish and subscribe. The subscriber can then query the object with a read() call. A read returns the length of the data read, in bytes.
- PPS has a limit of 200 open file descriptors per PPS object.
- The behavior of a PPS read differs from standard POSIX behavior. With PPS, if the allocated read buffer is too small for the data being read in, the read doesn't return a partial result; it fails.
It's safe for more than one subscriber to read from the objects because the pps manager guarantees that each PPS read() is atomic.
Attribute order
@Time
hour::17
minute::04
second::38This may be read in by a subscriber as, for instance:
@Time
second::38
hour::17
minute::04For information about routines that will help you parse attributes, see the PPS Encoding and Decoding API and PPS API reference chapters.
