You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks to be similar and tangentially related to #45.
Here's the relevant excerpt from my logs -
2018-05-03 22:39:32.637 [warn] websocket disconnected with reason {:remote, 1001, ""}, attempting reconnect
2018-05-03 22:39:32.919 [error] No handle_info/2 clause in Elixir.Nostrum.Shard.Session provided for {:ssl_closed, {:sslsocket, {:gen_tcp, #Port<0.16490>, :tls_connection, :undefined}, #PID<0.4982.0>}}
I'm able to trigger this by returning {:close, state} from a handle_cast/2 callback, although I get it when the remote party disconnects as well as is the case with the log above.
I've confirmed that the issue is happening in the close_loop/4function by adding the following match to the receive. Besides the print it's all just copied from the :tcp_closed match 🙃.
{:ssl_closed,^socket}->IO.inspect"received ssl_closed in close loop"new_conn=%{conn|socket: nil}debug=Utils.sys_debug(debug,:closed,state)purge_timer(timer_ref,:"websockex_close_timeout")state=Map.delete(state,:timer_ref)on_disconnect(reason,parent,debug,%{state|conn: new_conn})
As expected this prints the message and seems to be handled correctly. If this is how it should be handled (I'm unsure if we need to do anything special for ssl connections) I can open a PR. I'd probably need a little guidance to properly set up a test though.
The text was updated successfully, but these errors were encountered:
test"can close a https connection",contextdo# Close the original socketWebSockex.cast(context.pid,:close)assert_receive:normal_remote_closed# Test HTTPS{:ok,{server_ref,url}}=WebSockex.TestServer.start_https(self())on_exitfn->WebSockex.TestServer.shutdown(server_ref)end{:ok,_pid}=TestClient.start_link(url,%{})WebSockex.cast(pid,:close)assert_receive:normal_remote_closedend
Looks to be similar and tangentially related to #45.
Here's the relevant excerpt from my logs -
I'm able to trigger this by returning
{:close, state}
from ahandle_cast/2
callback, although I get it when the remote party disconnects as well as is the case with the log above.I've confirmed that the issue is happening in the
close_loop/4
function by adding the following match to the receive. Besides the print it's all just copied from the:tcp_closed
match 🙃.As expected this prints the message and seems to be handled correctly. If this is how it should be handled (I'm unsure if we need to do anything special for ssl connections) I can open a PR. I'd probably need a little guidance to properly set up a test though.
The text was updated successfully, but these errors were encountered: