Comments (2)
I'm not sure this will be applicable here, but when I worked on my Twitch IRC library, I introduced a tick()
function which would take care of all the necessary work the library would do during one iteration of the main loop. The user could then write their own main loop (which could include other, arbitrary code) and simply call tick()
within that loop. See the wiki on that project in case you want to see if you could potentially draw inspiration from it.
from wsserver.
Hello @domsson,
I don't know if an 'all-in-one' function is ideal for this case... I wanted to leave some things apart like: listening, accepting a connection, receiving frames, and leave the user to invoke them individually.
But you raised an interesting point: the approach I described in the issue was designed to use blocking routines: wait for a connection, wait for frames, and so on. In fact, the entire wsServer was designed this way.
Your approach on the other hand suggests non-blocking routines (and in fact for that you use epoll in your project). It would be interesting if these routines that I suggested could be non-blocking too so that the user could use them either with threads, select, poll, epoll, libevent, etc.
But maybe this requires even major changes in the source code since my routines couldn't block in the midst of a received frame for example, as they do at the moment.
from wsserver.
Related Issues (20)
- suggest for some conditions. HOT 1
- Ping - pthread_mutex_lock called on a destroyed mutex HOT 12
- Connection UID HOT 6
- Error building/compiling on mac silicon. HOT 2
- send_all function return value error HOT 1
- Problems with browsers connections HOT 1
- How can I create a list of connected clients using the wsServer library? (question) HOT 3
- Close Event Not Always Firing on Server HOT 4
- runtime error for left shifts with fsanitize=address,undefined in sha1.c HOT 3
- ws_getaddress() do not work in onmessage() on localhost HOT 2
- wsserver via ssl in linux environment HOT 1
- Optional forked server application model HOT 2
- <feature> Why not support IPv6 HOT 2
- Only works on a loopback adapter HOT 7
- Why would I want to use civetweb for WebSockets, if this exists? HOT 5
- License Change Consent - wsServer Project HOT 11
- mutiple sockets not working. HOT 16
- Problem with recent change to the calling sequence for the function 'ws_socket() HOT 4
- Server closes the socket after a time. How do I ensure it stays open? HOT 6
- Adding native wss (SSL) support [feature] HOT 4
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 wsserver.