Diffusion 6.2.0 User Manual

Start publishing with C

Create a C client that publishes data through topics on the Diffusion™ server.

The C client libraries rely on a number of dependencies. Depending on the
platform you are using, these dependencies might
be included in the client library. If they are not included in the client
library, ensure that the dependencies are available on your development
system.

For more information about dependencies on each supported
platform, see C.

The C client library statically links to Apache Portable Runtime (APR) version 1.5 with APR-util.
Ensure that you set APR_DECLARE_STATIC and
APU_DECLARE_STATIC before you use any APR includes. You can set these
values in the following ways:

By including diffusion.h before any
APR includes. The
diffusion.h file sets these
values.

To complete this example, you need a Diffusion server and a development
system with the .NET Framework
installed on it.

You also require a named user that has a role with the modify_topic and update_topic permissions.
For example, the "ADMINISTRATOR" role. For more information
about roles and permissions, see Role-based authorization.

The
cjson-publishing-example
binary is created in the
target/bin directory.

Run your C client from the command line.

The client updates the value of the processes topic. You can see the value of the
processes topic
by creating a subscribing client to subscribe
to the topic. For more information, see Start subscribing with C.

The completed cjson-publishing-example file
contains the following code: