To make our data available on the network, we create a SensorServer object in both of our projects. We need a variable to reference our server:
private SensorServer sensorServer = null;
In our AttachFeatures method, we create an instance of this object, and provide an event handler for the principle event: OnExecuteReadoutRequest. This event is triggered each time a sensor data request is received. It is also triggered when a subscription event is triggered, and an event message is being created. The SensorServer object takes care of registering required handlers on our XMPP client:
this.sensorServer = new SensorServer(this.xmppClient, true); this.sensorServer.OnExecuteReadoutRequest += async (sender, e) => ...