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

Serve multiple ports? #135

Open
cspain opened this issue Mar 2, 2020 · 1 comment
Open

Serve multiple ports? #135

cspain opened this issue Mar 2, 2020 · 1 comment

Comments

@cspain
Copy link

cspain commented Mar 2, 2020

Hey guys,

It is possible for Seasocks to listen and open multiple connections on more than one port? I am thinking of a scenario where we have, say a data channel on port 1234 and control channel on port 5678.

One way I thought of doing this is creating two server objects (one per channel) and having each do server.serve() on its own thread. The parent of these two threads could send data out using server.execute(connection->send) on each server object?

Is there a better way where I can call listen() and handle simultaneous connections on more than one port?

Thanks for creating a great tool!

-Chris

@hoytech
Copy link
Contributor

hoytech commented Mar 3, 2020

I haven't looked in detail, but I think the thread-per-listener approach is probably your best option. Hooking into the event loop isn't very easy (ie requires code modification) as we discussed a bit in #47 .

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

2 participants