Giter Club home page Giter Club logo

musen's People

Contributors

alffaza avatar dependabot[bot] avatar maroqijalil avatar nathan24zz avatar ryohilmi avatar segara2410 avatar threeal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

musen's Issues

Create a Broadcaster and a Listener Class

Move the currently broadcaster and listener program into a reuseable class. Those class must have a bool connect(int port) function that used to start the UDP connection, a void send(std::string data) function for the Broadcaster class and a std::string recover() function for the Listener class.

Rename Project into Musen

For some consideration, it's concluded to rename the project from previously housou (放送, hōsō, broadcast) into musen (無線, wireless). Changes should apply to everything from repository name, milestones, information, library name, namespace, etc.

Add a Simple Broadcaster and Listener Example

Add a simple broadcaster node that broadcast a message to another listener node. Makes sure the message could be received by multiple instances of listener node on different host.

Add Support to Filter Address

Add support to enable/disable communication to broadcast address, and add support to use custom addresses during communication.

Add Python Support

Rename the current musen package into musen_cpp (as a c++ implementation of Musenproject) and move it to the sub directory of this project. And add a new package named musen_py that will be used as a Python implementation of Musen project.

Add Dependabot Configuration

This issue suggests to add a Dependabot configuration in this project to check for a new update on GitHub Actions dependencies.

Add Vector of String Support in String Broadcaster

Add a vector of string support in the StringBroadcaster's send() function. When the send() function is called using vector of string and optional delimiter (default is comma, ,), the sent message will be the concatenation of the vector of string, separated by the delimiter. For example, with a vector of string {'foo', 'goo', '123'} and delimiter -, the broadcaster will send foo-goo-123.

Change to Pure C++ Library

Just like ichiro-its/keisan#51, change this project from ROS 2 package into a pure C++ library (still using CMake, but without ament_cmake).

This change is necessary because ROS 2 build dependency make it hard to implement a newer C++ version (C++17), custom format/lint rules, binary deployment, multi-platform support, etc.

Multiple Clients Handle in Server

As in the latest addition of base_server.cpp, it seems the server will only be able to handle one client during connect process.

// Accept incoming connection
auto sa_size = sizeof(sa);
new_sockfd = accept(
tcp_socket->get_sockfd(), (struct sockaddr *)&sa, reinterpret_cast<socklen_t *>(&sa_size));
if (get_new_sockfd() < 0) {
return false;
}

The solution is to make the accept process called by different function (could be accept()), or automatically run it on different thread, and then save the accepted client as a list.

String Listener Not Return the Actual Data

As in this code snippet:

std::string StringListener::receive(int length)
{
char * buffer = new char[length];
BaseListener::receive(buffer, length);
std::string message(buffer);
delete[] buffer;
return message;
}

The string listener just casting the buffer result into std::string without considering the received bytes size. This problem caused the returned data to be wrong if the received bytes is smaller than the requested length.

It's better to resize the message according to the received bytes size before returning the data.

Specify Data Type in Function Instead of Class

Specify the data type to be used in send and receive functions instead of in separate classes (e.g. BaseBroadcaster, Broadcaster<T>, and StringBroadcaster).

In the end, specifying the data type could be done as follow:

  • This will replace byte data send in the BaseBroadcaster
    Broadcaster broadcaster;
    broadcaster.send_raw(...);
  • This will replace struct data send in the Broadcaster<T>.
    Broadcaster broadcaster;
    broadcaster.send<T>(...);
  • This will replace string data send function in the StringBroadcaster.
    Broadcaster broadcaster;
    broadcaster.send_string(...);
  • etc.

Add Master Header

Add master header (housou/housou.hpp) that will be used by other project to include every public class which is available in this package.

Add Multicast Object

Add a Multicast object that broadcast data into a specific address (just like a Broadcaster object but instead of send data into a broadcast IP, it will send data into a specific IP). The add_target_host() and the enable_broadcast functions in the Broadcaster object should be removed too as the Broadcaster object will be purely only handle a broadcast communication.

Add Delimiter Support in String Listener

Add a delimiter support in the StringListener's receive() function. When using delimiter, the receive() function will separate the received string by some delimiters (could be a single char, const char *, or std:: string) so it will return a vector of string (std::vector<std::string>).

Remove Debian Deployment

This issue proposes to remove support for Debian deployment in this project since Debian is no longer being used to distribute this module.

Receive Full Data

Add support to receive full data in listener, client, and server. This feature could be achieved by separating receive function into receive and receive_up_to where receive_up_to will wait for data up to the requested size (non-blocking mode) while the receive function will wait for data until the requested size is achieved (blocking).

Support for Template Broadcaster and Listener

Add support for template broadcaster (Broadcaster<T>) and template listener (Listener<T>) that work just like the standard broadcaster and listener but instead of send/receive a std::string data, it send/receive a T data (intended for struct).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.