Comments (3)
This does not fix the issue as the memory has already been consumed before onMessage is called.
This needs to be done in Ratchet itself.
The following commit hardcodes a limit of 1000 bytes and solves the issue, ideally that would be some kind of configuration option.
from ratchet.
The message size can be limited when implementing the onMessage()
method as per Ratchet\MessageInterface. The example below stops processing the request if exceeding 4096 bytes.
// ...
public function onMessage(ConnectionInterface $from, $msg)
{
if (strlen($msg) > 4096) {
return;
}
// ...
}
// ...
from ratchet.
😉 That's the frame size in WebSocket parlance I suppose.
from ratchet.
Related Issues (20)
- Deprecated: Creation of dynamic property Ratchet\Server\IoConnection::$WebSocket is deprecated HOT 1
- not getting response header on ratchet
- Getting error on production - strpos(): Passing null to parameter HOT 1
- Update to react/socket 1.14.0
- Content-Security-Policy: The page’s settings blocked the loading of a resource at ws://domain.name:8080/ (“connect-src”).
- can't distinguishing connection's close code HOT 1
- How to use WSS with SSL and HTTPS ? HOT 1
- Needed make a update in guzzle dependencies HOT 2
- Request blocked HOT 1
- Uncaught Error: Class "MyApp\Chat" not found
- Add compatibility with Symfony 7 HOT 3
- Under Share hosting onOpen() is working fine but onClose() is not working. HOT 2
- websocat gives errors when closing connection and received message is garbled. HOT 3
- Server is going down HOT 2
- Can Ratchet send message from php? HOT 1
- Reviving Ratchet: Let's give Ratchet the love it deserves! HOT 15
- Deprecation Warnings HOT 1
- Restarting WS after reaching 1024 opened files limit HOT 3
- Execute multiple zmq send in same event loop with php ratchet
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 ratchet.