diff --git a/Arduino/ArduinoParticipant.cpp b/Arduino/ArduinoParticipant.cpp index 4897569..1e8f396 100644 --- a/Arduino/ArduinoParticipant.cpp +++ b/Arduino/ArduinoParticipant.cpp @@ -88,7 +88,7 @@ void ParticipantUDP::Receive() { #endif } -bool ParticipantUDP::SendTo(RemoteParticipantUDP* remoteParticipant, int bufferSize) { +bool ParticipantUDP::SendTo(ParticipantSocket* remoteParticipant, int bufferSize) { #if defined(ARDUINO) && defined(HAS_WIFI) // std::cout << "Sending to:\n " << remoteParticipant->ipAddress << ":" // << remoteParticipant->port << "\n"; diff --git a/Arduino/ArduinoParticipant.h b/Arduino/ArduinoParticipant.h index 7531302..6f0f5c1 100644 --- a/Arduino/ArduinoParticipant.h +++ b/Arduino/ArduinoParticipant.h @@ -9,7 +9,7 @@ class ParticipantUDP : public ParticipantUDPGeneric { public: void Setup(); void Receive(); - bool SendTo(RemoteParticipantUDP* remoteParticipant, int bufferSize); + bool SendTo(ParticipantSocket* remoteParticipant, int bufferSize); bool Publish(IMessage* msg); protected: diff --git a/EspIdf/EspIdfParticipant.cpp b/EspIdf/EspIdfParticipant.cpp index 44dc0e8..7f26c0b 100644 --- a/EspIdf/EspIdfParticipant.cpp +++ b/EspIdf/EspIdfParticipant.cpp @@ -182,7 +182,7 @@ bool ParticipantUDP::Send(IMessage* msg) { return this->SendTo(this->remoteSite, bufferSize); } -bool ParticipantUDP::SendTo(RemoteParticipantUDP* remoteParticipant, +bool ParticipantUDP::SendTo(ParticipantSocket* remoteParticipant, int bufferSize) { #if defined(IDF_VER) uint16_t port = ntohs(dest_addr.sin_port); diff --git a/EspIdf/EspIdfParticipant.h b/EspIdf/EspIdfParticipant.h index 1c74ebf..7ac2302 100644 --- a/EspIdf/EspIdfParticipant.h +++ b/EspIdf/EspIdfParticipant.h @@ -23,7 +23,7 @@ class ParticipantUDP : public ParticipantUDPGeneric { void Setup(int localPort, const char* remoteIpAddress, int remotePort); void Receive(); - bool SendTo(RemoteParticipantUDP* remoteParticipant, int bufferSize); + bool SendTo(ParticipantSocket* remoteParticipant, int bufferSize); bool Publish(IMessage* msg); // bool SendTest(); diff --git a/Participants/ParticipantSocket.cpp b/Participants/ParticipantSocket.cpp new file mode 100644 index 0000000..9b5c224 --- /dev/null +++ b/Participants/ParticipantSocket.cpp @@ -0,0 +1,24 @@ +#include "ParticipantSocket.h" + +#include + +namespace RoboidControl { + +ParticipantSocket::ParticipantSocket(const char* ipAddress, int port) { + // make a copy of the ip address string + int addressLength = (int)strlen(ipAddress); + int stringLength = addressLength + 1; + char* addressString = new char[stringLength]; +#if defined(_WIN32) || defined(_WIN64) + strncpy_s(addressString, stringLength, ipAddress, + addressLength); // Leave space for null terminator +#else + strncpy(addressString, ipAddress, addressLength); +#endif + addressString[addressLength] = '\0'; + + this->ipAddress = addressString; + this->port = port; +} + +} \ No newline at end of file diff --git a/Participants/ParticipantSocket.h b/Participants/ParticipantSocket.h new file mode 100644 index 0000000..82b8678 --- /dev/null +++ b/Participants/ParticipantSocket.h @@ -0,0 +1,28 @@ +#pragma once + +#include "Participant.h" + +namespace RoboidControl { + +class ParticipantSocket : public Participant { + public: + /// @brief Create a new participant with the given communcation info + /// @param ipAddress The IP address of the participant + /// @param port The UDP port of the participant + /// @remarks This does not belong here, it should move to ParticipantUDP or + /// something like that in the future + ParticipantSocket(const char* ipAddress, int port); + + /// @brief The Ip Address of a participant. + /// @remarks This does not belong here, it should move to ParticipantUDP or + /// something like that in the future + const char* ipAddress = "0.0.0.0"; + /// @brief The port number for UDP communication with the participant. + /// @remarks This does not belong here, it should move to ParticipantUDP or + /// something like that in the future + unsigned int port = 0; + + bool Send(IMessage* msg) override; +}; + +} \ No newline at end of file diff --git a/Participants/ParticipantUDP.cpp b/Participants/ParticipantUDP.cpp index 66adb7c..0f6581d 100644 --- a/Participants/ParticipantUDP.cpp +++ b/Participants/ParticipantUDP.cpp @@ -12,7 +12,7 @@ #include "Things/DistanceSensor.h" #include "Things/TouchSensor.h" -#include +// #include namespace RoboidControl { @@ -20,10 +20,10 @@ namespace RoboidControl { ParticipantRegistry ParticipantUDPGeneric::registry; -RemoteParticipantUDP* ParticipantRegistry::Get(const char* ipAddress, +ParticipantSocket* ParticipantRegistry::Get(const char* ipAddress, unsigned int port) { #if !defined(NO_STD) - for (RemoteParticipantUDP* participant : ParticipantRegistry::participants) { + for (ParticipantSocket* participant : ParticipantRegistry::participants) { if (participant == nullptr) continue; if (strcmp(participant->ipAddress, ipAddress) == 0 && @@ -39,9 +39,9 @@ RemoteParticipantUDP* ParticipantRegistry::Get(const char* ipAddress, return nullptr; } -RemoteParticipantUDP* ParticipantRegistry::Get(unsigned char participantId) { +ParticipantSocket* ParticipantRegistry::Get(unsigned char participantId) { #if !defined(NO_STD) - for (RemoteParticipantUDP* participant : ParticipantRegistry::participants) { + for (ParticipantSocket* participant : ParticipantRegistry::participants) { if (participant == nullptr) continue; if (participant->networkId == participantId) @@ -52,14 +52,14 @@ RemoteParticipantUDP* ParticipantRegistry::Get(unsigned char participantId) { return nullptr; } -RemoteParticipantUDP* ParticipantRegistry::Add(const char* ipAddress, +ParticipantSocket* ParticipantRegistry::Add(const char* ipAddress, unsigned int port) { - RemoteParticipantUDP* participant = new RemoteParticipantUDP(ipAddress, port); + ParticipantSocket* participant = new ParticipantSocket(ipAddress, port); Add(participant); return participant; } -void ParticipantRegistry::Add(RemoteParticipantUDP* participant) { +void ParticipantRegistry::Add(ParticipantSocket* participant) { Participant* foundParticipant = Get(participant->networkId); // Get(participant->ipAddress, participant->port); @@ -84,7 +84,7 @@ void ParticipantRegistry::Add(RemoteParticipantUDP* participant) { } } -void ParticipantRegistry::Remove(RemoteParticipantUDP* participant) { +void ParticipantRegistry::Remove(ParticipantSocket* participant) { // participants.remove(participant); } @@ -93,31 +93,14 @@ RemoteParticipantUDP** ParticipantRegistry::GetAll() const { return ParticipantRegistry::participants; } #else -const std::list& ParticipantRegistry::GetAll() const { +const std::list& ParticipantRegistry::GetAll() const { return ParticipantRegistry::participants; } #endif #pragma endregion ParticipantRegistry -RemoteParticipantUDP::RemoteParticipantUDP(const char* ipAddress, int port) { - // make a copy of the ip address string - int addressLength = (int)strlen(ipAddress); - int stringLength = addressLength + 1; - char* addressString = new char[stringLength]; -#if defined(_WIN32) || defined(_WIN64) - strncpy_s(addressString, stringLength, ipAddress, - addressLength); // Leave space for null terminator -#else - strncpy(addressString, ipAddress, addressLength); -#endif - addressString[addressLength] = '\0'; - - this->ipAddress = addressString; - this->port = port; -} - -bool RemoteParticipantUDP::Send(IMessage* msg) { +bool ParticipantSocket::Send(IMessage* msg) { // No message is actually sent, because this class has no networking // implementation return false; @@ -126,7 +109,7 @@ bool RemoteParticipantUDP::Send(IMessage* msg) { #pragma region Init ParticipantUDPGeneric::ParticipantUDPGeneric(int port) - : RemoteParticipantUDP("127.0.0.1", port) { + : ParticipantSocket("127.0.0.1", port) { this->name = "ParticipantUDP"; this->remoteSite = nullptr; if (this->port == 0) @@ -145,12 +128,12 @@ ParticipantUDPGeneric::ParticipantUDPGeneric(int port) ParticipantUDPGeneric::ParticipantUDPGeneric(const char* ipAddress, int port, int localPort) - : RemoteParticipantUDP("127.0.0.1", localPort) { + : ParticipantSocket("127.0.0.1", localPort) { this->name = "ParticipantUDP"; if (this->port == 0) this->isIsolated = true; else - this->remoteSite = new RemoteParticipantUDP(ipAddress, port); + this->remoteSite = new ParticipantSocket(ipAddress, port); registry.Add(this); this->root = Thing::LocalRoot(); // Participant::LocalParticipant->root; @@ -311,7 +294,7 @@ void ParticipantUDPGeneric::ReceiveData(unsigned char packetSize, unsigned int senderPort) { // std::cout << "Receive data from " << senderIpAddress << ":" << senderPort // << std::endl; - RemoteParticipantUDP* sender = + ParticipantSocket* sender = this->registry.Get(senderIpAddress, senderPort); if (sender == nullptr) { sender = this->registry.Add(senderIpAddress, senderPort); @@ -325,7 +308,7 @@ void ParticipantUDPGeneric::ReceiveData(unsigned char packetSize, } void ParticipantUDPGeneric::ReceiveData(unsigned char bufferSize, - RemoteParticipantUDP* sender) { + ParticipantSocket* sender) { unsigned char msgId = this->buffer[0]; // std::cout << "receive msg " << (int)msgId << "\n"; // std::cout << " buffer size = " <<(int) bufferSize << "\n"; @@ -398,7 +381,7 @@ void ParticipantUDPGeneric::ReceiveData(unsigned char bufferSize, #endif } -void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, +void ParticipantUDPGeneric::Process(ParticipantSocket* sender, ParticipantMsg* msg) { #if defined(DEBUG) std::cout << this->name << ": Process ParticipantMsg " << (int)msg->networkId @@ -406,7 +389,7 @@ void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, #endif } -void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, +void ParticipantUDPGeneric::Process(ParticipantSocket* sender, NetworkIdMsg* msg) { #if defined(DEBUG) std::cout << this->name << ": process NetworkIdMsg " << (int)this->networkId @@ -422,7 +405,7 @@ void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, } } -void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, +void ParticipantUDPGeneric::Process(ParticipantSocket* sender, InvestigateMsg* msg) { #if defined(DEBUG) std::cout << this->name << ": Process InvestigateMsg [" << (int)msg->networkId @@ -430,16 +413,16 @@ void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, #endif } -void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, +void ParticipantUDPGeneric::Process(ParticipantSocket* sender, ThingMsg* msg) { #if defined(DEBUG) std::cout << this->name << ": process ThingMsg [" << (int)msg->networkId << "/" << (int)msg->thingId << "] " << (int)msg->thingType << " " << (int)msg->parentId << "\n"; #endif - RemoteParticipantUDP* owner = registry.Get(msg->networkId); + ParticipantSocket* owner = registry.Get(msg->networkId); if (owner == nullptr) { - owner = new RemoteParticipantUDP(sender->ipAddress, sender->port); + owner = new ParticipantSocket(sender->ipAddress, sender->port); owner->networkId = msg->networkId; registry.Add(owner); } @@ -461,7 +444,7 @@ void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, thing->SetParent(nullptr); } -Thing* ParticipantUDPGeneric::ProcessNewThing(RemoteParticipantUDP* owner, +Thing* ParticipantUDPGeneric::ProcessNewThing(ParticipantSocket* owner, ThingMsg* msg, bool isRemote) { switch (msg->thingType) { @@ -476,7 +459,7 @@ Thing* ParticipantUDPGeneric::ProcessNewThing(RemoteParticipantUDP* owner, } } -void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, +void ParticipantUDPGeneric::Process(ParticipantSocket* sender, NameMsg* msg) { #if defined(DEBUG) std::cout << this->name << ": process NameMsg [" << (int)msg->networkId << "/" @@ -509,7 +492,7 @@ void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, #endif } -void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, +void ParticipantUDPGeneric::Process(ParticipantSocket* sender, ModelUrlMsg* msg) { #if defined(DEBUG) std::cout << this->name << ": process ModelUrlMsg [" << (int)msg->networkId @@ -517,7 +500,7 @@ void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, #endif } -void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, +void ParticipantUDPGeneric::Process(ParticipantSocket* sender, PoseMsg* msg) { #if !defined(DEBUG) && !defined(NO_STD) std::cout << this->name << ": process PoseMsg [" << (int)this->networkId @@ -541,7 +524,7 @@ void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, thing->SetAngularVelocity(msg->angularVelocity); } -void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, +void ParticipantUDPGeneric::Process(ParticipantSocket* sender, BinaryMsg* msg) { #if defined(DEBUG) std::cout << this->name << ": process BinaryMsg [" << (int)msg->networkId @@ -564,7 +547,7 @@ void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, } } -void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, +void ParticipantUDPGeneric::Process(ParticipantSocket* sender, TextMsg* msg) { #if defined(DEBUG) std::cout << this->name << ": process TextMsg " << (int)msg->textLength << " " @@ -572,7 +555,7 @@ void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, #endif } -void ParticipantUDPGeneric::Process(RemoteParticipantUDP* sender, +void ParticipantUDPGeneric::Process(ParticipantSocket* sender, DestroyMsg* msg) { #if defined(DEBUG) std::cout << this->name << ": process Destroy [" << (int)msg->networkId << "/" diff --git a/Participants/ParticipantUDP.h b/Participants/ParticipantUDP.h index 159062e..ffca6ac 100644 --- a/Participants/ParticipantUDP.h +++ b/Participants/ParticipantUDP.h @@ -10,7 +10,8 @@ #include "Messages/PoseMsg.h" #include "Messages/TextMsg.h" #include "Messages/ThingMsg.h" -#include "Participant.h" + +#include "ParticipantSocket.h" #if !defined(NO_STD) #include @@ -31,26 +32,7 @@ namespace RoboidControl { constexpr int MAX_SENDER_COUNT = 256; -class RemoteParticipantUDP : public Participant { - public: - /// @brief Create a new participant with the given communcation info - /// @param ipAddress The IP address of the participant - /// @param port The UDP port of the participant - /// @remarks This does not belong here, it should move to ParticipantUDP or - /// something like that in the future - RemoteParticipantUDP(const char* ipAddress, int port); - /// @brief The Ip Address of a participant. - /// @remarks This does not belong here, it should move to ParticipantUDP or - /// something like that in the future - const char* ipAddress = "0.0.0.0"; - /// @brief The port number for UDP communication with the participant. - /// @remarks This does not belong here, it should move to ParticipantUDP or - /// something like that in the future - unsigned int port = 0; - - bool Send(IMessage* msg) override; -}; /// @brief class which manages all known participants class ParticipantRegistry { @@ -59,43 +41,43 @@ class ParticipantRegistry { /// @param ipAddress The IP address of the participant /// @param port The port number of the participant /// @return The participant or a nullptr when it could not be found - RemoteParticipantUDP* Get(const char* ipAddress, unsigned int port); + ParticipantSocket* Get(const char* ipAddress, unsigned int port); /// @brief Retrieve a participant by its network ID /// @param networkID The network ID of the participant /// @return The participant or a nullptr when it could not be found - RemoteParticipantUDP* Get(unsigned char networkID); + ParticipantSocket* Get(unsigned char networkID); /// @brief Add a participant with the given details /// @param ipAddress The IP address of the participant /// @param port The port number of the participant /// @return The added participant - RemoteParticipantUDP* Add(const char* ipAddress, unsigned int port); + ParticipantSocket* Add(const char* ipAddress, unsigned int port); /// @brief Add a participant /// @param participant The participant to add - void Add(RemoteParticipantUDP* participant); + void Add(ParticipantSocket* participant); /// @brief Remove a participant /// @param participant The participant to remove - void Remove(RemoteParticipantUDP* participant); + void Remove(ParticipantSocket* participant); private: #if defined(NO_STD) public: - RemoteParticipantUDP** GetAll() const; + ParticipantSocket** GetAll() const; int count = 0; private: - RemoteParticipantUDP** participants; + ParticipantSocket** participants; #else public: /// @brief Get all participants /// @return All participants - const std::list& GetAll() const; + const std::list& GetAll() const; private: /// @brief The list of known participants - std::list participants; + std::list participants; #endif }; @@ -111,7 +93,7 @@ class ParticipantRegistry { /// participant is created which can be obtained using /// RoboidControl::IsolatedParticipant::Isolated(). /// @sa RoboidControl::Thing::Thing() -class ParticipantUDPGeneric : public RemoteParticipantUDP { +class ParticipantUDPGeneric : public ParticipantSocket { #pragma region Init public: @@ -139,7 +121,7 @@ class ParticipantUDPGeneric : public RemoteParticipantUDP { bool isIsolated = false; /// @brief The remote site when this participant is connected to a site - RemoteParticipantUDP* remoteSite = nullptr; + ParticipantSocket* remoteSite = nullptr; /// The interval in milliseconds for publishing (broadcasting) data on the /// local network @@ -192,27 +174,27 @@ class ParticipantUDPGeneric : public RemoteParticipantUDP { void ReceiveData(unsigned char bufferSize, char* senderIpAddress, unsigned int senderPort); - void ReceiveData(unsigned char bufferSize, RemoteParticipantUDP* remoteParticipant); + void ReceiveData(unsigned char bufferSize, ParticipantSocket* remoteParticipant); virtual void SetupUDP(int localPort, const char* remoteIpAddress, int remotePort) = 0; virtual void ReceiveUDP() = 0; - virtual void Process(RemoteParticipantUDP* sender, ParticipantMsg* msg); - virtual void Process(RemoteParticipantUDP* sender, NetworkIdMsg* msg); - virtual void Process(RemoteParticipantUDP* sender, InvestigateMsg* msg); + virtual void Process(ParticipantSocket* sender, ParticipantMsg* msg); + virtual void Process(ParticipantSocket* sender, NetworkIdMsg* msg); + virtual void Process(ParticipantSocket* sender, InvestigateMsg* msg); - virtual void Process(RemoteParticipantUDP* sender, ThingMsg* msg); - virtual Thing* ProcessNewThing(RemoteParticipantUDP* sender, + virtual void Process(ParticipantSocket* sender, ThingMsg* msg); + virtual Thing* ProcessNewThing(ParticipantSocket* sender, ThingMsg* msg, bool isRemote); - virtual void Process(RemoteParticipantUDP* sender, NameMsg* msg); - virtual void Process(RemoteParticipantUDP* sender, ModelUrlMsg* msg); - virtual void Process(RemoteParticipantUDP* sender, PoseMsg* msg); - virtual void Process(RemoteParticipantUDP* sender, BinaryMsg* msg); - virtual void Process(RemoteParticipantUDP* sender, TextMsg* msg); - virtual void Process(RemoteParticipantUDP* sender, DestroyMsg* msg); + virtual void Process(ParticipantSocket* sender, NameMsg* msg); + virtual void Process(ParticipantSocket* sender, ModelUrlMsg* msg); + virtual void Process(ParticipantSocket* sender, PoseMsg* msg); + virtual void Process(ParticipantSocket* sender, BinaryMsg* msg); + virtual void Process(ParticipantSocket* sender, TextMsg* msg); + virtual void Process(ParticipantSocket* sender, DestroyMsg* msg); #pragma endregion Receive diff --git a/Participants/SiteServer.cpp b/Participants/SiteServer.cpp index 9baa03e..2e6ee30 100644 --- a/Participants/SiteServer.cpp +++ b/Participants/SiteServer.cpp @@ -56,7 +56,7 @@ void SiteServer::UpdateMyThings() { #pragma region Receive -void SiteServer::Process(RemoteParticipantUDP* sender, ParticipantMsg* msg) { +void SiteServer::Process(ParticipantSocket* sender, ParticipantMsg* msg) { if (msg->networkId != sender->networkId) { // std::cout << this->name << " received New Client -> " << // sender->ipAddress @@ -67,9 +67,9 @@ void SiteServer::Process(RemoteParticipantUDP* sender, ParticipantMsg* msg) { } } -void SiteServer::Process(RemoteParticipantUDP* sender, NetworkIdMsg* msg) {} +void SiteServer::Process(ParticipantSocket* sender, NetworkIdMsg* msg) {} -void SiteServer::Process(RemoteParticipantUDP* sender, ThingMsg* msg) { +void SiteServer::Process(ParticipantSocket* sender, ThingMsg* msg) { Thing* thing = sender->Get(msg->networkId, msg->thingId); if (thing == nullptr) { // new Thing(sender, (Thing::Type)msg->thingType, msg->thingId); diff --git a/Participants/SiteServer.h b/Participants/SiteServer.h index 97de7bf..343abee 100644 --- a/Participants/SiteServer.h +++ b/Participants/SiteServer.h @@ -33,9 +33,9 @@ class SiteServer : public ParticipantUDPGeneric { protected: unsigned long nextPublishMe = 0; - virtual void Process(RemoteParticipantUDP* sender, ParticipantMsg* msg) override; - virtual void Process(RemoteParticipantUDP* sender, NetworkIdMsg* msg) override; - virtual void Process(RemoteParticipantUDP* sender, ThingMsg* msg) override; + virtual void Process(ParticipantSocket* sender, ParticipantMsg* msg) override; + virtual void Process(ParticipantSocket* sender, NetworkIdMsg* msg) override; + virtual void Process(ParticipantSocket* sender, ThingMsg* msg) override; #pragma endregion Receive diff --git a/Posix/PosixParticipant.cpp b/Posix/PosixParticipant.cpp index 6ae6cef..8c11e98 100644 --- a/Posix/PosixParticipant.cpp +++ b/Posix/PosixParticipant.cpp @@ -90,7 +90,7 @@ void ParticipantUDP::Receive() { #endif } -bool ParticipantUDP::SendTo(RemoteParticipantUDP* remoteParticipant, int bufferSize) { +bool ParticipantUDP::SendTo(ParticipantSocket* remoteParticipant, int bufferSize) { #if defined(__unix__) || defined(__APPLE__) // std::cout << "Send to " << remoteParticipant->ipAddress << ":" << ntohs(remoteParticipant->port) // << "\n"; diff --git a/Posix/PosixParticipant.h b/Posix/PosixParticipant.h index 17dd23f..b4f85c8 100644 --- a/Posix/PosixParticipant.h +++ b/Posix/PosixParticipant.h @@ -9,7 +9,7 @@ class ParticipantUDP : public ParticipantUDPGeneric { public: void Setup(int localPort, const char* remoteIpAddress, int remotePort); void Receive(); - bool SendTo(RemoteParticipantUDP* remoteParticipant, int bufferSize); + bool SendTo(ParticipantSocket* remoteParticipant, int bufferSize); bool Publish(IMessage* msg); protected: diff --git a/Windows/WindowsParticipant.cpp b/Windows/WindowsParticipant.cpp index dfaa445..49d14e5 100644 --- a/Windows/WindowsParticipant.cpp +++ b/Windows/WindowsParticipant.cpp @@ -102,7 +102,7 @@ void ParticipantUDP::Receive() { #endif // _WIN32 || _WIN64 } -bool ParticipantUDP::SendTo(RemoteParticipantUDP* remoteParticipant, int bufferSize) { +bool ParticipantUDP::SendTo(ParticipantSocket* remoteParticipant, int bufferSize) { #if defined(_WIN32) || defined(_WIN64) char ip_str[INET_ADDRSTRLEN]; inet_ntop(AF_INET, &(remote_addr.sin_addr), ip_str, INET_ADDRSTRLEN); diff --git a/Windows/WindowsParticipant.h b/Windows/WindowsParticipant.h index 3d241ba..9ddc7cf 100644 --- a/Windows/WindowsParticipant.h +++ b/Windows/WindowsParticipant.h @@ -9,7 +9,7 @@ class ParticipantUDP : public ParticipantUDPGeneric { public: void Setup(int localPort, const char* remoteIpAddress, int remotePort); void Receive(); - bool SendTo(RemoteParticipantUDP* remoteParticipant, int bufferSize); + bool SendTo(ParticipantSocket* remoteParticipant, int bufferSize); bool Publish(IMessage* msg); protected: