diff options
Diffstat (limited to 'proto-flightgear/ftnoir_protocol_fg.cpp')
-rw-r--r-- | proto-flightgear/ftnoir_protocol_fg.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/proto-flightgear/ftnoir_protocol_fg.cpp b/proto-flightgear/ftnoir_protocol_fg.cpp index 3e0f955c..e1101c0f 100644 --- a/proto-flightgear/ftnoir_protocol_fg.cpp +++ b/proto-flightgear/ftnoir_protocol_fg.cpp @@ -25,9 +25,14 @@ void flightgear::pose(const double* headpose) { (void) outSocket.writeDatagram(reinterpret_cast<const char*>(&FlightData), sizeof(FlightData), destIP, static_cast<quint16>(s.port)); } -bool flightgear::correct() +module_status flightgear::check_status() { - return outSocket.bind(QHostAddress::Any, 0, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint); + if (outSocket.bind(QHostAddress::Any, 0, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint)) + return status_ok(); + else + return error(QCoreApplication::translate("flightgear", "Can't bind to [%1.%2.%3.%4]:%5") + .arg(s.ip1).arg(s.ip2).arg(s.ip3).arg(s.ip4) + .arg(s.port)); } OPENTRACK_DECLARE_PROTOCOL(flightgear, FGControls, flightgearDll) |