Comments (1)
Seasocks is an asynchronous server, using the linux-specific epoll() API. There is one thread responsible for managing all events, like reading from the socket, buffering messages, writing to the socket, etc.
If multiple threads could all interact with the socket, then there would need to be locking to protect the data-structures this thread uses, which would increase complexity and decrease performance.
But this typically isn't a problem, since actually sending/receiving messages takes so little resources. Usually it's your own code that you want to run in a separate thread anyway. What you can do is create a worker thread pool that takes requests off a queue. The workers will then do their expensive processing, and push the responses onto another queue, and then wake up the seasocks thread to send the messages.
You can also have multiple processes all accepting connections from the same websocket if you use SO_REUSEPORT.
from seasocks.
Related Issues (20)
- Make Maximum Message Size Configurable HOT 1
- Own Error page support HOT 3
- Support for OPTIONS request for CORS reasons HOT 11
- Conform to conan licensing practices HOT 2
- contiguous stream of data ? HOT 1
- PathHandler for /:id style API
- Title in readme HOT 2
- It's easy to get files outside of the static dir HOT 1
- Clarify use case and security disclosure etc
- unxi domain socket support for websocket
- Conan center build 1.4.5 failed HOT 12
- Clang 15 CI build uses ARM instead of x86_64 HOT 1
- Use Seasocks with makefile HOT 9
- Static link seasocks HOT 1
- Test migration to Catch 3.x
- Deleted HOT 2
- sending large HTTP responses doesn't work
- UTF-8 support
- type overflow _bytesSent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seasocks.