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

Use Libasyncd in more then one thread #38

Open
Roma004 opened this issue Oct 6, 2020 · 0 comments
Open

Use Libasyncd in more then one thread #38

Roma004 opened this issue Oct 6, 2020 · 0 comments

Comments

@Roma004
Copy link

Roma004 commented Oct 6, 2020

Hello there! I'm currently trying to write multithreaded servers in C++ and decided to use Libasyncd, as it seemed simple and straightforward to work with. I already managed to write a simple http server following the examples, but it looks like your library only allows it to work in one thread.
I also tried changing the "server.thread" setting to "1", but this just caused the server to stop working without any errors. Apparently, it is not sent to a separate thread, as well as it is not launched in several threads, since when sending a request into the url of my server, I get "Connection refused".
So, my question is:

  1. (most importantly) is it possible to use this library to start the server in several(let's say in 4) threads, without running the code 4 times in 4 different sessions?
  2. what is the "server.thread" parameter responsible for, how should it work, and when should it be used? This was not clear
    from the documentation.
  3. if you can't use multithreading using the library, can you suggest different ways to solve this problem?

I would be very grateful if I get answers to these questions! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant