chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.8k stars 421 forks source link

Create a websockets library #8994

Open buddha314 opened 6 years ago

buddha314 commented 6 years ago

I know this will probably get picked up by the community, but I thought I'd throw it out there.

Perusing the Wikipedia Comparision of WebSockets page I came across libwebsockets which might be a nice base line.

The most compelling use case (for me) is moving real time simulation visualization into HTML5 applications using technology like D3 or whatever the new hotness is.

marcoscleison commented 6 years ago

@buddha314 , I can work on a version for libwebsocket. My issue is that I could not integrate libwebsocket socket handler with the Chrest. Now I can create an exclusive websocket class with libwebsocket, but the port cannot be the same port where Chrest http is running. I recognize that this is not the ideal solution, but it is what I am figuring out. The problem is: 1)Chrest has an async event loop. 2) libwebsocket has it own async event loop. I do not know how to share the socket descriptor with both loops.

But if you do not mind to connect with WebSocket service with a different port than the Chrest http rest server. I can create special Class that to handles websocket connections.

buddha314 commented 6 years ago

I don't honestly know the best architecture. In looking around, it looks like Flask uses separate packages to handle websockets: https://stackoverflow.com/questions/32935877/best-option-currently-available-for-websockets-with-flask-on-python3#32936484 So that might be the correct direction.. I think ...?

marcoscleison commented 6 years ago

I am exploring libwebsocket. As soon as possible I will inform my experiments results.