Updated with scheduler
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "StreamString.h"
|
||||
#include "BasicSocket.h"
|
||||
#include "DebugBrokerWrapper.h"
|
||||
#include "DebugFastScheduler.h"
|
||||
#include "ObjectRegistryDatabase.h"
|
||||
#include "ClassRegistryItem.h"
|
||||
#include "ObjectBuilder.h"
|
||||
@@ -119,7 +120,12 @@ bool DebugService::Initialise(StructuredDataI & data) {
|
||||
(void)data.Read("TcpLogPort", logPort);
|
||||
}
|
||||
|
||||
(void)data.Read("StreamIP", streamIP);
|
||||
StreamString tempIP;
|
||||
if (data.Read("StreamIP", tempIP)) {
|
||||
streamIP = tempIP;
|
||||
} else {
|
||||
streamIP = "127.0.0.1";
|
||||
}
|
||||
|
||||
uint32 suppress = 1;
|
||||
if (data.Read("SuppressTimeoutLogs", suppress)) {
|
||||
@@ -148,14 +154,21 @@ bool DebugService::Initialise(StructuredDataI & data) {
|
||||
REPORT_ERROR(ErrorManagement::FatalError, "DebugService: Failed to open TCP Server Socket");
|
||||
return false;
|
||||
}
|
||||
if (!tcpServer.Listen(controlPort)) {
|
||||
REPORT_ERROR(ErrorManagement::FatalError, "DebugService: Failed to Listen on port %u", controlPort);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!udpSocket.Open()) {
|
||||
REPORT_ERROR(ErrorManagement::FatalError, "DebugService: Failed to open UDP Socket");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!logServer.Open()) {
|
||||
REPORT_ERROR(ErrorManagement::FatalError, "DebugService: Failed to open Log Server Socket");
|
||||
return false;
|
||||
}
|
||||
(void)logServer.Listen(logPort);
|
||||
|
||||
if (threadService.Start() != ErrorManagement::NoError) {
|
||||
REPORT_ERROR(ErrorManagement::FatalError, "DebugService: Failed to start Server thread");
|
||||
@@ -201,6 +214,10 @@ void DebugService::PatchRegistry() {
|
||||
PatchItemInternal("MemoryMapSynchronisedMultiBufferInputBroker", &b8);
|
||||
static DebugMemoryMapSynchronisedMultiBufferOutputBrokerBuilder b9;
|
||||
PatchItemInternal("MemoryMapSynchronisedMultiBufferOutputBroker", &b9);
|
||||
|
||||
// Patch Scheduler
|
||||
static ObjectBuilderT<DebugFastScheduler> schedBuilder;
|
||||
PatchItemInternal("FastScheduler", &schedBuilder);
|
||||
}
|
||||
|
||||
void DebugService::ProcessSignal(DebugSignalInfo* s, uint32 size) {
|
||||
@@ -295,9 +312,6 @@ static bool RecursiveGetFullObjectName(ReferenceContainer *container, const Obje
|
||||
bool DebugService::GetFullObjectName(const Object &obj, StreamString &fullPath) {
|
||||
fullPath = "";
|
||||
if (RecursiveGetFullObjectName(ObjectRegistryDatabase::Instance(), obj, fullPath)) {
|
||||
StreamString abs = "Root.";
|
||||
abs += fullPath;
|
||||
fullPath = abs;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -311,7 +325,6 @@ ErrorManagement::ErrorType DebugService::Server(ExecutionInfo & info) {
|
||||
if (info.GetStage() == ExecutionInfo::TerminationStage) return ErrorManagement::NoError;
|
||||
if (info.GetStage() == ExecutionInfo::StartupStage) {
|
||||
serverThreadId = Threads::Id();
|
||||
if (!tcpServer.Listen(controlPort)) return ErrorManagement::FatalError;
|
||||
return ErrorManagement::NoError;
|
||||
}
|
||||
|
||||
@@ -375,7 +388,6 @@ ErrorManagement::ErrorType DebugService::LogStreamer(ExecutionInfo & info) {
|
||||
if (info.GetStage() == ExecutionInfo::TerminationStage) return ErrorManagement::NoError;
|
||||
if (info.GetStage() == ExecutionInfo::StartupStage) {
|
||||
logStreamerThreadId = Threads::Id();
|
||||
if (!logServer.Listen(logPort)) return ErrorManagement::FatalError;
|
||||
return ErrorManagement::NoError;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user