Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transport interface to concatenate transports [12290] #2103

Merged
merged 16 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions examples/C++/RTPSTest_as_socket/TestReaderSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,42 @@
class TestReaderSocket
{
public:

TestReaderSocket();

virtual ~TestReaderSocket();

eprosima::fastrtps::rtps::RTPSParticipant* mp_participant;

eprosima::fastrtps::rtps::RTPSReader* mp_reader;

eprosima::fastrtps::rtps::ReaderHistory* mp_history;
bool init(std::string ip,uint32_t port);

bool init(
std::string ip,
uint32_t port);

void run();
class MyListener:public eprosima::fastrtps::rtps::ReaderListener

class MyListener : public eprosima::fastrtps::rtps::ReaderListener
{
public:
MyListener():m_received(0){};
~MyListener(){};

MyListener()
: m_received(0)
{
}

~MyListener()
{
}

void onNewCacheChangeAdded(
eprosima::fastrtps::rtps::RTPSReader* reader,
const eprosima::fastrtps::rtps::CacheChange_t* const change) override;
uint32_t m_received;
}m_listener;
}
m_listener;

};

Expand Down
28 changes: 20 additions & 8 deletions examples/C++/RTPSTest_as_socket/TestWriterSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,27 @@
#include <cstdio>
#include <cstdint>

class TestWriterSocket {
class TestWriterSocket
{

public:
TestWriterSocket();
virtual ~TestWriterSocket();
eprosima::fastrtps::rtps::RTPSParticipant* mp_participant;
eprosima::fastrtps::rtps::RTPSWriter* mp_writer;
eprosima::fastrtps::rtps::WriterHistory* mp_history;
bool init(std::string ip,uint32_t port);
void run(uint16_t nmsgs);

TestWriterSocket();

virtual ~TestWriterSocket();

eprosima::fastrtps::rtps::RTPSParticipant* mp_participant;

eprosima::fastrtps::rtps::RTPSWriter* mp_writer;

eprosima::fastrtps::rtps::WriterHistory* mp_history;

bool init(
std::string ip,
uint32_t port);

void run(
uint16_t nmsgs);
};

#endif /* TESTWRITER_H_ */
4 changes: 3 additions & 1 deletion include/fastdds/rtps/network/NetworkFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ class NetworkFactory
* Allows registration of a transport dynamically. Only the transports built into FastRTPS
* are supported here (although it can be easily extended at NetworkFactory.cpp)
* @param descriptor Structure that defines all initial configuration for a given transport.
* @param properties Optional policy to specify additional parameters of the created transport.
*/
bool RegisterTransport(
const fastdds::rtps::TransportDescriptorInterface* descriptor);
const fastdds::rtps::TransportDescriptorInterface* descriptor,
const fastrtps::rtps::PropertyPolicy* properties = nullptr);

/**
* Walks over the list of transports, opening every possible channel that can send through
Expand Down
2 changes: 2 additions & 0 deletions include/fastdds/rtps/network/SenderResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#ifndef _FASTDDS_RTPS_SENDER_RESOURCE_H
#define _FASTDDS_RTPS_SENDER_RESOURCE_H

#include <fastdds/rtps/common/Types.h>

#include <functional>
#include <vector>
#include <chrono>
Expand Down
Loading