Comments (5)
So from what I can see about message fragmentation, messages are split into multiple frames. So your Emacs API would be more aptly named :on-frame
because it receives frames, which are part of some message.
So it seems like I can recreate a proper conceptual :on-message
by using websocket-frame-completep
to concatenate the contents of each frame until completep
is t
.
I think your existing API is good for streaming, so it'd be cool if it had both on-frame
and on-message
for the advanced or simple case. Closing, I can achieve what I need with this.
from emacs-websocket.
By the way, thanks for publishing this package, it's great! π π
from emacs-websocket.
My memory isn't perfect about this, but my recollection is that I should just be returning whole messages, not just frames. Looking at the code, websocket-process-input-on-open-ws
should repeatedly read frames until the message is completed. websocket-read-frame
is supposed to return nil if the frame is not completed, and it doesn't look like it does that. Perhaps that is the cause of this issue.
So, are you sure that closed is correct for this?
from emacs-websocket.
I'm not sure what's correct behavior for you. π€ But I encountered this when making a message that's large, e.g. 100kb. I think you could literally just replace the data
in my JS example with "a".repeat(100000)
to reproduce this. βοΈ
from emacs-websocket.
After reviewing the code, you're right in your analysis of this. It is documented that on-message
actually deals with frames. Would you like to contribute a function to automatically concatenate messages to callback on a completed message? That might help other users.
from emacs-websocket.
Related Issues (20)
- websocket-frame-text error HOT 1
- Add release tags HOT 3
- Custom headers in handshake HOT 4
- How to handle an error occured in `websocket-outer-filter`? HOT 6
- Speed feedback HOT 10
- Randomly losing connections under emacs-ipython-notebook with version 1.11 HOT 5
- Error (websocket): in callback `on-message': JSON readtable error HOT 4
- Setting case-fold-search to nil results "Incorrect handhake from websocket" error HOT 7
- declares GPL-3+, but provided full-text license is GPL-2+ HOT 3
- Please tag a 1.12 release HOT 1
- Please consider adapting websocket-functional-test.el to use ert-deftest HOT 12
- TLSv1.3 HOT 1
- Branch rename breaks package installation HOT 6
- websocket-test.el: βfletβ is an obsolete macro (as of [emacs] 24.3) HOT 3
- websocket-to-bytes signal type error HOT 8
- Support connecting through proxies HOT 7
- infinite failure loop - emacs locked up HOT 18
- error 403 with ein over proxy HOT 14
- Push to ELPA? HOT 3
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 emacs-websocket.