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

Set Realtime WebSocket Buffer #379

Closed
dansari88 opened this issue Nov 7, 2015 · 2 comments
Closed

Set Realtime WebSocket Buffer #379

dansari88 opened this issue Nov 7, 2015 · 2 comments
Labels

Comments

@dansari88
Copy link

I am working on a realtime multiplayer game which was built using Ratchet 0.3.3, Laravel 5 and PHP 5.5.9, The server OS is Ubuntu. The server sends approximately 500 bytes of data in each cycle to every user via WebSocket (hundreds of users).
It looks like WebSocket is buffering the requests and sends 5 to 6 requests at once (500 bytes each).
We have 30 millisecond cycles. Is there a way to manually set the WebSocket buffer settings so I can send each request in every cycle?

@dansari88 dansari88 changed the title Realtime WebSocket requests problem! Realtime WebSocket Problem! Nov 7, 2015
@dansari88 dansari88 changed the title Realtime WebSocket Problem! Set Realtime WebSocket Buffer Nov 8, 2015
@mbonneau
Copy link
Member

mbonneau commented Nov 8, 2015

Hi @dansari88 ,

I have not had a chance to really look at the issue too hard - but thought you may be able to try:

socket_set_option(socket_import_stream($stream->stream), SOL_TCP, TCP_NODELAY, true);

@cboden
Copy link
Member

cboden commented Dec 19, 2015

This buffering is happening at the TCP level, not the WebSocket level and is therefore outside the scope of Ratchet. @mbonneau is correct on the correct function use on the socket however. :) These kind of issues are more targeted towards React.

@cboden cboden closed this as completed Dec 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants