Howto:Implementing custom I/O Protocols

From FlightGear wiki
Jump to: navigation, search
This article is a stub. You can help the wiki by expanding it.
WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.

Objective

Demonstrate how to implement a custom I/O protocol using C++

Background

FlightGear supports a plethora of I/O options. Whenever none of the existing protocols works for a particular use-case, people may need to create their own I/O protocol by implemented it in C++ code. For this, FlightGear -and SimGear- provide a handful of APIs and building blocks that allow new protocols to be easily implemented by people familiar with C++.

Hard-coded protocols generally live under $FG_SRC/Network

SGIOChannel

SGSocket

Introducing FGProtocol

Registering your new protocol

Exposing FGProtocol to Nasal

Multi-threading

SGSubsystem-based

  • Httpd

SGPropertyChangeListener

  • FGCom