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

Support for broadcasting #166

Open
OlivierSohn opened this issue Feb 12, 2018 · 2 comments
Open

Support for broadcasting #166

OlivierSohn opened this issue Feb 12, 2018 · 2 comments

Comments

@OlivierSohn
Copy link
Contributor

Hello,

First, thanks for providing this library, it's very helpful!

I'm using it in the context of a multiplayer-game where I often send the same data to many clients at once.

To do that efficiently, I can write this function to factor the serialization of the data:

sendNBinaryData :: WebSocketsData a => [Connection] -> a -> IO ()

And I wonder if it would be theoretically possible to also factor the compression of the messages (in the library)? Or is some client-specific information included in the message that makes every message different, and makes this factorization impossible? (I'm not very familiar with networking protocols)

Thanks!

@tolysz
Copy link

tolysz commented Mar 12, 2018

Something should be possible with per package compression (and not the stream).
But there are no API calls for sendUncompressed and sendPreCompressed

@OlivierSohn
Copy link
Contributor Author

OlivierSohn commented Mar 12, 2018

@tolysz when you say 'package', do you mean a in

sendNBinaryData :: WebSocketsData a => [Connection] -> a -> IO ()

?

Also I'm not sure to understand what sendUncompressed and sendPreCompressed would do, can you give an example / explain a bit more the semantics?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants