Radio Information Object Exchange
RIOX is an open source .NET library for transporting Radio Information objects over the network, using SOAP serialization for cross-platform interoperability. The RIOX library contains both a client and a server. It is intended to be used by applications that wish to transport their state objects over TCP/IP to client applications.
RIOX was written by David McKenzie, K1FSY, and is free of charge under the GPL license.
The RIOX Library
The RIOX Library contains three classes: RIOXServer, RIOXClient, and RIOXCommand. It requires you to provide a serializable object for transport from the Server to the Clients. The RIOXCommand class is used to send commands back to the server over the same link.
The RIOX Server
The RIOX server serializes objects and sends them to clients. To use it, simply tell it which object to serialize and when/how often to send object updates to clients. Updates can occur automatically using an internal timer or manually by calling a method.
Constructor
public RIOXServer(Object dataObject, IPAddress bindAddress, int port)
- dataObject is the object for transport
- IPAddress should be set to IPAddress.Any or IPAddress.Loopback depending on the application
- port is the TCP port the server will listen on
Properties
- DataObject: The object intended for serialization
- IsStarted: Read-only property is set to true if the server is running
- ObjectUpdateInterval: Interval in milliseconds to send updates to the clients
- SendUpdatesAtInterval: Boolean that tells the server whether or not to automatically send updates, default is True
Methods
- Start(): Start the server.
- Close(): Stop the server.
- SendObjectUpdates(): Manually sends the object to all connected clients
Events
- CommandEvent: Fired when a RIOXCommand object is sent by a client.
void ServerCommandEvent(object sender, RIOXServer.CommandEventArgs e)
- CommandEventArgs has three properties, command, data, and client id.
The RIOX Client
The RIOXClient class connects to a RIOXServer and fires an event when an object is received from the server.
Constructor
public RIOXClient(String hostname, int port)
- hostname is the host running the RIOXServer
- port is the port the server is running on
The client automatically connects when created.
Properties
- IsConnected: Set to true if the connection is established, false if it is not.
Methods
- Close: Close the connection to the server and shuts down all internal threads.
- SendCommand: Sends a RIOXCommand object to the server.
Events
- ObjectReceivedEvent: Fired when the client receives an event from the server.
void ClientObjectReceivedEvent(object o, RIOXClient.ObjectReceivedEventArgs e)
- ObjectReceivedEventArgs has one property: DataObject, which is the object that was transported.
The DataObject
The RIOX DataObject is specified by the programmer. It must implement ISerializable. It also must be compiled as a class library so that your server can interact with clients (they need to access the same object).
RadioData is an example object that is part of RIOXTestClient. In order for the server to use the object, it must reference the test client's object.
Ideally, the DataObject should implement INotify as well, so that the server can trigger a client object update only when data has changed.
Projects implementing RIOX
Obtaining RIOX
RIOX is available via git. The source code can be browsed here, or cloned from http://www.vhfwiki.com/git/RIOX.git/