Closed Revent closed 5 years ago
If you mean you want to use multiple processes for sending frames, you probably should comment on this ticket: https://github.com/ninenines/gun/issues/58
I use one process for sending frames. Only when I do ws_upgrade I get this error.
But you do this in a different process, surely? You need to provide more information.
i use one gen_server for ws and http query.
like this and when i call cast i got notowner https://gist.github.com/Revent/8649f3eb2c7e7e25da72de7eae23207d
The error is incorrect, but it's expected to have an error when doing this. You can't do POST requests on a Websocket connection. Websocket takes over the whole connection and only Websocket data can be sent once the connection is upgraded.
If you need to do both you'll want two connections.
Note that HTTP/2 has recently added Websocket support but few servers support it (Cowboy does if enabled) and Gun has no support for it yet, so that's still far off.
ok, thanks.
After gun:ws_upgrade any requests in the same connection are break with
{notowner,"Operations are restricted to the owner of the connection."}
how can i avoid it?