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

TSL not working: asio handle_timer error #632

Open
goodxianping opened this issue Mar 28, 2017 · 7 comments
Open

TSL not working: asio handle_timer error #632

goodxianping opened this issue Mar 28, 2017 · 7 comments

Comments

@goodxianping
Copy link

goodxianping commented Mar 28, 2017

hi, @zaphoyd , When I use TSL, I have some problems. Please help analyze, thank you!

[2017-03-28 10:17:53] [info] asio handle_timer error: system:125 (Operation Canceled)
[2017-03-28 10:17:53] [fail] WebSocket Connection 192.168.0.100:8443 - "" /websocket/ganqixian 0 websocketpp.transport.asio:3 Underlying Transport Error
[2017-03-28 10:17:53] [error] handle_connect error: Underlying Transport Error
[2017-03-28 10:17:53] [connect] Successful connection
[2017-03-28 10:17:53] [info] asio handle_timer error: system:125 (Operation Canceled)
[2017-03-28 10:17:53] [info] asio handle_timer error: system:125 (Operation Canceled)
[2017-03-28 10:17:53] [error] handle_connect error: Underlying Transport Error
[2017-03-28 10:17:53] [info] asio handle_timer error: system:125 (Operation Canceled)
[2017-03-28 10:17:53] [error] handle_transport_init received error: invalid state
[2017-03-28 10:17:53] [info] asio handle_timer error: system:125 (Operation Canceled)

@goodxianping
Copy link
Author

goodxianping commented Mar 28, 2017

i use demo command line, it works fine. but when i Integrate the code into my project, encountered the above error. this problem has been bothering me for a few days.

In addition, I see the server has received the client connection.

@goodxianping goodxianping changed the title TSL not working TSL not working: asio handle_timer error Mar 28, 2017
@goodxianping
Copy link
Author

It's really weird.
When I complie both client_no_tls.hpp and client_tls.hpp, lead to the above error.
I comment the client_no_tls code, wss works fine.

@goodxianping
Copy link
Author

goodxianping commented Mar 29, 2017

typedef websocketpp::client<websocketpp::config::asio_tls_client> wsclient_tls; typedef websocketpp::client<websocketpp::config::asio_client> wsclient;
note: At the same time to define the above code, NOTLS woks fine, TLS woks failed.

[2017-03-28 10:17:53] [info] asio handle_timer error: system:125 (Operation Canceled)
[2017-03-28 10:17:53] [fail] WebSocket Connection 192.168.0.100:8443 - "" /websocket/ganqixian 0 websocketpp.transport.asio:3 Underlying Transport Error
[2017-03-28 10:17:53] [error] handle_connect error: Underlying Transport Error
[2017-03-28 10:17:53] [connect] Successful connection
[2017-03-28 10:17:53] [info] asio handle_timer error: system:125 (Operation Canceled)
[2017-03-28 10:17:53] [info] asio handle_timer error: system:125 (Operation Canceled)
[2017-03-28 10:17:53] [error] handle_connect error: Underlying Transport Error
[2017-03-28 10:17:53] [info] asio handle_timer error: system:125 (Operation Canceled)
[2017-03-28 10:17:53] [error] handle_transport_init received error: invalid state
[2017-03-28 10:17:53] [info] asio handle_timer error: system:125 (Operation Canceled)

@goodxianping
Copy link
Author

how to support both ws and wss client?

@goodxianping
Copy link
Author

goodxianping commented Apr 15, 2017

i have fixed this issue by added the code:

websocketpp-0.7.0/websocketpp/transport/asio/connection.hpp:352

` void handle_timer(timer_ptr, timer_handler callback,
lib::asio::error_code const & ec)
{
if(this-get_raw_socket().is_open())
return ;

	   if (ec) {
	       if (ec == lib::asio::error::operation_aborted) {
	           callback(make_error_code(transport::error::operation_aborted));
	       } else {
	           log_err(log::elevel::info,"asio handle_timer",ec);
	           callback(make_error_code(error::pass_through));
	       }
	   } else {
	       callback(lib::error_code());
	   }
	}`

@stefanofiorentino
Copy link

this row doesn't make sense

if(this-get_raw_socket().is_open())

could you kindly edit the message with right code?

@goodxianping
Copy link
Author

sorry, i dont know how to edit messae with right way
if(this-get_raw_socket().is_open()) ----> if(this->get_raw_socket().is_open())

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

No branches or pull requests

3 participants