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

feature/server-client-protocol-version-2 #1072

Merged
merged 104 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
9c467c2
protocol version 0 & 1 introduced
rex-schilasky Apr 18, 2023
7a9fbf0
clang-tidy fixes
rex-schilasky Apr 18, 2023
d9d8a98
full upward and downward compatibility by starting 2 server sessions …
rex-schilasky Apr 19, 2023
9c86df1
tcp port fixed to new v1
rex-schilasky Apr 19, 2023
642a248
clang-tidy fixes
rex-schilasky Apr 19, 2023
835972a
config switches added to activate/deactivate service protocols
rex-schilasky Apr 22, 2023
a997158
Update ecal/core/src/ecal_def.h
rex-schilasky Apr 22, 2023
f7bc1b5
eCAL::STcpHeader extended with version and header size
rex-schilasky May 4, 2023
a9b9f71
Core CMake: Restructured source_groups of files for IDEs
FlorianReimold May 5, 2023
134f98d
Merge branch 'master' of https://github.com/eclipse-ecal/ecal into fe…
FlorianReimold May 8, 2023
7dbaccf
Intermediate state
FlorianReimold May 11, 2023
3615f62
Refactoring and a lot of debug output, especially for V1
FlorianReimold May 12, 2023
4572a43
Couple of clang-tidy fixes
FlorianReimold May 12, 2023
7ec8402
Removed unused variables
FlorianReimold May 12, 2023
06db8d0
Fixed bugs in v0 implementation and added many logging messages. Also…
FlorianReimold May 12, 2023
d386c8a
Enabled tcp_nodelay option
FlorianReimold May 12, 2023
3e058d3
removed old code and fixed logging
FlorianReimold May 12, 2023
ef77af1
Moved tcp server implementation to an object library and added first …
FlorianReimold May 12, 2023
05817da
Fixed compile issue
FlorianReimold May 12, 2023
2c5a91f
Fixed a TODO (weak_ptr instead of this) and started preparing asio_tc…
FlorianReimold May 12, 2023
8e45f76
Fixed Linux linker issue and prepared files for client
FlorianReimold May 16, 2023
1f14933
Implemented client code (doesn't compile, currently)
FlorianReimold May 22, 2023
97c2a69
Added new service implementation that can already transport binary data
FlorianReimold May 24, 2023
3e1d75b
Improved Client & Server, Added tests, added errorcode class
FlorianReimold May 26, 2023
8cdb7ba
Fixed RAII issue
FlorianReimold May 30, 2023
c3df2a0
event improvements
FlorianReimold May 31, 2023
81f2360
Intermediate state that runs all callbacks perfectly, except when the…
FlorianReimold Jun 1, 2023
05c69f6
First version that has correct RAII and callback behavior
FlorianReimold Jun 1, 2023
6f1f13c
First version where error callbacks appear to work properly
FlorianReimold Jun 1, 2023
db73b08
First version that fulfills all tests
FlorianReimold Jun 2, 2023
65bb66a
added another test and Fixed some TODOs
FlorianReimold Jun 2, 2023
d8f32fb
ecal_service is now a separate lib
FlorianReimold Jun 2, 2023
7cb1aa4
Some code cleanup
FlorianReimold Jun 2, 2023
d44423e
Removed CMake Code for generate export headers, as that doesn't appea…
FlorianReimold Jun 2, 2023
59c1a20
Added test for blocking service call
FlorianReimold Jun 5, 2023
ab902bb
Improved constness
FlorianReimold Jun 5, 2023
2fbb3fc
Added test for error-cases of blocking service call
FlorianReimold Jun 5, 2023
622001f
Added first support for returning from a blocking call without a runn…
FlorianReimold Jun 6, 2023
1bf02a0
Improvements
FlorianReimold Jun 6, 2023
ab8029d
Fixed compiler warnings
FlorianReimold Jun 6, 2023
1e14156
Some refactoring
FlorianReimold Jun 6, 2023
fd3a2a9
Cleaned logging
FlorianReimold Jun 7, 2023
fd7fb4d
Cleanup and TODO handling
FlorianReimold Jun 7, 2023
0126020
Added V0 implementation that passes most tests
FlorianReimold Jun 7, 2023
7383eb5
Fixed crash in V0 protocol
FlorianReimold Jun 12, 2023
c6c6ea8
All test now run for v0 and v1 protocol
FlorianReimold Jun 12, 2023
5523cc1
Solved some TODOs and compiler warnings
FlorianReimold Jun 12, 2023
9cbde77
Fixed most clang tidy warnings
FlorianReimold Jun 12, 2023
f51e056
Added Test for big payloads. That test only works for V1
FlorianReimold Jun 14, 2023
15f4037
Started with a shutdown solution that shifts the responsibility to eCAL
FlorianReimold Jun 14, 2023
eb049b7
Added API to serialize Service call executions
FlorianReimold Jun 15, 2023
30d38bc
Added test for single-threaded service callbacks and optimized a few …
FlorianReimold Jun 16, 2023
3c56444
Refactored files
FlorianReimold Jun 16, 2023
97a2884
Added manager classes that handle a proper shutdown
FlorianReimold Jun 19, 2023
44a1fc9
Merge branch 'master' into feature/server-client-protocol-version-2
FlorianReimold Jun 26, 2023
2dc62b0
integrated server
FlorianReimold Jun 28, 2023
d91b409
It compile and also seems to communicate properly
FlorianReimold Jun 30, 2023
51abace
Fixed RAII issues
FlorianReimold Jun 30, 2023
080f1d9
Fixed a few things to satisfy tests, but there is still a lot to do
FlorianReimold Jun 30, 2023
96e527c
Fixed most tests
FlorianReimold Jul 3, 2023
ae6d4d1
Fixed last test
FlorianReimold Jul 3, 2023
7b63c58
Fixed a couple compile warnings
FlorianReimold Jul 3, 2023
309c32c
Trying to solve gcc compile issue
FlorianReimold Jul 3, 2023
f9ed84e
fixed compile issue on ubuntu in debug mode
FlorianReimold Jul 4, 2023
6ad824b
fixed includes
FlorianReimold Jul 4, 2023
d4471a9
Fixed many compiler warnings
FlorianReimold Jul 4, 2023
44ba0e1
Merge branch 'master' of https://github.com/eclipse-ecal/ecal into fe…
FlorianReimold Jul 4, 2023
549b16a
Merge branch 'feature/server-client-protocol-version-2' of https://gi…
FlorianReimold Jul 4, 2023
5f4fd13
Fixed a deadlock bug on Ubuntu. The tests should work now.
FlorianReimold Jul 11, 2023
ec88344
fixed log message
FlorianReimold Jul 11, 2023
a987acf
Fixed nullptr execption in ecal core
FlorianReimold Jul 11, 2023
4f586ad
Fixed a couple of raii issues and switched to IPv6 to hopefully suppo…
FlorianReimold Jul 12, 2023
c89f0eb
Made clientserver test thread safe
FlorianReimold Jul 12, 2023
c3cc48b
Improved Tests
FlorianReimold Jul 12, 2023
991ec5e
Fixed clang tidy warnings and a compile issue
FlorianReimold Jul 12, 2023
2edee91
Merge branch 'master' of https://github.com/eclipse-ecal/ecal into fe…
FlorianReimold Jul 26, 2023
74ce097
Merge branch 'master' of https://github.com/eclipse-ecal/ecal into fe…
FlorianReimold Jul 27, 2023
b8c20cc
added loop around test to better trigger the ubuntu segfault
FlorianReimold Jul 28, 2023
a3b4670
Fixed crash caused by non-thread-safe behavior of asio sockets
FlorianReimold Aug 2, 2023
6068b7d
Fixed many clang tidy warnings
FlorianReimold Aug 2, 2023
d2306ed
Tests: Improved robustness on slow machines and improved execution sp…
FlorianReimold Aug 3, 2023
b7f0148
Solved many TODOs
FlorianReimold Aug 22, 2023
d43f8e7
Merge branch 'master' of https://github.com/eclipse-ecal/ecal into fe…
FlorianReimold Aug 22, 2023
5583ac8
Made CServiceClientImpl a shared_ptr
FlorianReimold Aug 22, 2023
58ada8a
Fixed missing include
FlorianReimold Aug 22, 2023
e40cf51
Fixed more TODOs
FlorianReimold Aug 24, 2023
6c8125f
Added another test testing the non-parallel service calls
FlorianReimold Sep 7, 2023
4435a13
Added sample and Readme.md
FlorianReimold Sep 8, 2023
bd2f43f
added readme and sampel
FlorianReimold Sep 8, 2023
5c57ccb
Revised folder structure
FlorianReimold Sep 8, 2023
74568a1
Added missing includes
FlorianReimold Sep 11, 2023
de9f8b2
Added a lot of doxygen documentation
FlorianReimold Sep 12, 2023
b6fde93
Some refactoring
FlorianReimold Sep 12, 2023
63c4598
Removed unnecessary int return value from service callback
FlorianReimold Sep 12, 2023
e0cf790
Removed some TODOs
FlorianReimold Sep 13, 2023
e2ec436
Increased timeouts in tests, so they hopefully won't fail due to thos…
FlorianReimold Sep 14, 2023
81fa6d5
Added comments pointing to potential issues that can arise in the future
FlorianReimold Sep 14, 2023
1bd7c4f
Fixed potential deadlock when calling a service blocking after it had…
FlorianReimold Sep 19, 2023
7b52bc2
Merge branch 'master' of https://github.com/eclipse-ecal/ecal into fe…
FlorianReimold Sep 19, 2023
135f3fc
Added more documentation to Readme.md
FlorianReimold Sep 19, 2023
7405aac
Updated HDF5 again
FlorianReimold Sep 21, 2023
6232564
A little refactoring
FlorianReimold Sep 28, 2023
67c713d
Merge branch 'master' of https://github.com/eclipse-ecal/ecal into fe…
FlorianReimold Sep 28, 2023
c1474c0
Small refactoring
FlorianReimold Oct 12, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void ServiceWidget::autoSizeColumns()
example_service_pb.set_uname("eCALRPCService____");
example_service_pb.set_pid(999999);
example_service_pb.set_sname("eCALRPCService____");
example_service_pb.set_tcp_port(999999);
example_service_pb.set_tcp_port_v1(999999);

eCAL::pb::Method* method = example_service_pb.mutable_methods()->Add();
method->set_mname("ShutdownProcessName____");
Expand Down
2 changes: 1 addition & 1 deletion app/mon/mon_gui/src/widgets/models/service_tree_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ QVariant ServiceTreeItem::data(Columns column, Qt::ItemDataRole role) const
}
else if (column == Columns::TCP_PORT)
{
return service_.tcp_port();
return service_.tcp_port_v1();
}
else if (column == Columns::MNAME)
{
Expand Down
2 changes: 1 addition & 1 deletion app/mon/mon_tui/src/model/monitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class MonitorModel
service.process_name = std::move(*s.mutable_pname());
service.unit_name = std::move(*s.mutable_uname());
service.registration_clock = s.rclock();
service.tcp_port = s.tcp_port();
service.tcp_port = s.tcp_port_v1();
for(auto &m: *s.mutable_methods())
{
auto &method = service.methods.emplace_back();
Expand Down
226 changes: 118 additions & 108 deletions ecal/core/cfg/ecal.ini

Large diffs are not rendered by default.

118 changes: 47 additions & 71 deletions ecal/core/include/ecal/ecal_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,87 +36,66 @@ namespace eCAL
**/
struct SReceiveCallbackData
{
SReceiveCallbackData()
{
buf = nullptr;
size = 0;
id = 0;
time = 0;
clock = 0;
};
void* buf; //!< payload buffer
long size; //!< payload buffer size
long long id; //!< publisher id (SetId())
long long time; //!< publisher send time in µs
long long clock; //!< publisher send clock
void* buf = nullptr; //!< payload buffer
long size = 0; //!< payload buffer size
long long id = 0; //!< publisher id (SetId())
long long time = 0; //!< publisher send time in µs
long long clock = 0; //!< publisher send clock
};

/**
* @brief eCAL publisher event callback struct.
**/
struct SPubEventCallbackData
{
SPubEventCallbackData()
{
type = pub_event_none;
time = 0;
clock = 0;
};
eCAL_Publisher_Event type; //!< publisher event type
long long time; //!< publisher event time in µs
long long clock; //!< publisher event clock
std::string tid; //!< topic id of the of the connected subscriber (for pub_event_update_connection only)
std::string ttype; //!< topic type information of the connected subscriber (for pub_event_update_connection only)
std::string tdesc; //!< topic descriptor information of the connected subscriber (for pub_event_update_connection only)
eCAL_Publisher_Event type = pub_event_none; //!< publisher event type
long long time = 0; //!< publisher event time in µs
long long clock = 0; //!< publisher event clock
std::string tid; //!< topic id of the of the connected subscriber (for pub_event_update_connection only)
std::string ttype; //!< topic type information of the connected subscriber (for pub_event_update_connection only)
std::string tdesc; //!< topic descriptor information of the connected subscriber (for pub_event_update_connection only)
};

/**
* @brief eCAL subscriber event callback struct.
**/
struct SSubEventCallbackData
{
SSubEventCallbackData()
{
type = sub_event_none;
time = 0;
clock = 0;
};
eCAL_Subscriber_Event type; //!< subscriber event type
long long time; //!< subscriber event time in µs
long long clock; //!< subscriber event clock
std::string tid; //!< topic id of the of the connected publisher (for sub_event_update_connection only)
std::string ttype; //!< topic type information of the connected publisher (for sub_event_update_connection only)
std::string tdesc; //!< topic descriptor information of the connected publisher (for sub_event_update_connection only)
eCAL_Subscriber_Event type = sub_event_none; //!< subscriber event type
long long time = 0; //!< subscriber event time in µs
long long clock = 0; //!< subscriber event clock
std::string tid; //!< topic id of the of the connected publisher (for sub_event_update_connection only)
std::string ttype; //!< topic type information of the connected publisher (for sub_event_update_connection only)
std::string tdesc; //!< topic descriptor information of the connected publisher (for sub_event_update_connection only)
};

/**
* @brief eCAL service attributes.
**/
struct SServiceAttr
{
std::string key; //!< unique service key (internal)
std::string hname; //!< host name
std::string pname; //!< process name
std::string uname; //!< process unit name
std::string sname; //!< service name
std::string sid; //!< service id
int pid = 0; //!< process id
unsigned short tcp_port = 0; //!< service tcp port
std::string key; //!< unique service key (internal)
std::string hname; //!< host name
std::string pname; //!< process name
std::string uname; //!< process unit name
std::string sname; //!< service name
std::string sid; //!< service id
int pid = 0; //!< process id

// internal protocol specifics
unsigned int version = 0; //!< service protocol version
unsigned short tcp_port_v0 = 0; //!< service tcp port protocol version 0
unsigned short tcp_port_v1 = 0; //!< service tcp port protocol version 1
};

/**
* @brief eCAL client event callback struct.
**/
struct SClientEventCallbackData
{
SClientEventCallbackData()
{
type = client_event_none;
time = 0;
};
eCAL_Client_Event type; //!< event type
long long time; //!< event time in µs
SServiceAttr attr; //!< event related service attributes
eCAL_Client_Event type = client_event_none; //!< event type
long long time = 0; //!< event time in µs
SServiceAttr attr; //!< event related service attributes
};

/**
Expand All @@ -131,20 +110,17 @@ namespace eCAL
std::string sname; //!< service name
std::string sid; //!< service id
int pid = 0; //!< process id

unsigned int version = 0; //!< client version
};

/**
* @brief eCAL server event callback struct.
**/
struct SServerEventCallbackData
{
SServerEventCallbackData()
{
type = server_event_none;
time = 0;
};
eCAL_Server_Event type; //!< event type
long long time; //!< event time in µs
eCAL_Server_Event type = server_event_none; //!< event type
long long time = 0; //!< event time in µs
};

/**
Expand All @@ -153,50 +129,50 @@ namespace eCAL
* @param topic_name_ The topic name of the received message.
* @param data_ Data struct containing payload, timestamp and publication clock.
**/
typedef std::function<void(const char* topic_name_, const struct SReceiveCallbackData* data_)> ReceiveCallbackT;
using ReceiveCallbackT = std::function<void (const char *, const struct SReceiveCallbackData *)>;

/**
* @brief Timer callback function type.
**/
typedef std::function<void(void)> TimerCallbackT;
using TimerCallbackT = std::function<void ()>;

/**
* @brief Registration callback type.
*
* @param sample_ The sample protocol buffer registration payload buffer.
* @param sample_size_ The payload buffer size.
**/
typedef std::function<void(const char* sample_, int sample_size_)> RegistrationCallbackT;
using RegistrationCallbackT = std::function<void (const char *, int)>;

/**
* @brief Publisher event callback function type.
*
* @param topic_name_ The topic name of the publisher that triggered the event.
* @param data_ Event callback data structure with the event specific informations.
* @param data_ Event callback data structure with the event specific information.
**/
typedef std::function<void(const char* topic_name_, const struct SPubEventCallbackData* data_)> PubEventCallbackT;
using PubEventCallbackT = std::function<void (const char *, const struct SPubEventCallbackData *)>;

/**
* @brief Subscriber event callback function type.
*
* @param topic_name_ The topic name of the subscriber that triggered the event.
* @param data_ Event callback data structure with the event specific informations.
* @param data_ Event callback data structure with the event specific information.
**/
typedef std::function<void(const char* topic_name_, const struct SSubEventCallbackData* data_)> SubEventCallbackT;
using SubEventCallbackT = std::function<void (const char *, const struct SSubEventCallbackData *)>;

/**
* @brief Client event callback function type.
*
* @param name_ The name of the connection that triggered the event.
* @param data_ Event callback data structure with the event specific informations.
* @param data_ Event callback data structure with the event specific information.
**/
typedef std::function<void(const char* name_, const struct SClientEventCallbackData* data_)> ClientEventCallbackT;
using ClientEventCallbackT = std::function<void (const char *, const struct SClientEventCallbackData *)>;

/**
* @brief Server event callback function type.
*
* @param name_ The name of the connection that triggered the event.
* @param data_ Event callback data structure with the event specific informations.
* @param data_ Event callback data structure with the event specific information.
**/
typedef std::function<void(const char* name_, const struct SServerEventCallbackData* data_)> ServerEventCallbackT;
using ServerEventCallbackT = std::function<void (const char *, const struct SServerEventCallbackData *)>;
};
6 changes: 6 additions & 0 deletions ecal/core/include/ecal/ecal_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ namespace eCAL
ECAL_API bool IsTopicTypeSharingEnabled ();
ECAL_API bool IsTopicDescriptionSharingEnabled ();

/////////////////////////////////////
// service
/////////////////////////////////////
ECAL_API bool IsServiceProtocolV0Enabled ();
ECAL_API bool IsServiceProtocolV1Enabled ();

/////////////////////////////////////
// experimental
/////////////////////////////////////
Expand Down
Loading