Move socket_init_handler from pre_init to init_asio #530
pre_init happens after bind/listen/accept, preventing socket options that affect those system calls from being set in time.
This commit is contained in:
1 parent
f5d14f3ad3
commit
6f128a5499
3 files changed
+12
-8
No files matched your search
@@ -1,4 +1,8 @@
|
||||
HEAD
|
||||
- Improvement: Move the socket_init_handler to execute as a part of init_asio
|
||||
rather than connection pre_init. This allows setting of socket options prior
|
||||
to the bind/listen/accept system calls. Thank you ChristianRobl3D for
|
||||
reporting #530.
|
||||
|
||||
0.7.0 - 2016-02-22
|
||||
- MINOR BREAKING SOCKET POLICY CHANGE: Asio transport socket policy method
|
||||
|
||||
@@ -171,6 +171,10 @@ protected:
|
||||
m_socket = lib::make_shared<lib::asio::ip::tcp::socket>(
|
||||
lib::ref(*service));
|
||||
|
||||
if (m_socket_init_handler) {
|
||||
m_socket_init_handler(m_hdl, *m_socket);
|
||||
}
|
||||
|
||||
m_state = READY;
|
||||
|
||||
return lib::error_code();
|
||||
@@ -204,10 +208,6 @@ protected:
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_socket_init_handler) {
|
||||
m_socket_init_handler(m_hdl,*m_socket);
|
||||
}
|
||||
|
||||
m_state = READING;
|
||||
|
||||
callback(lib::error_code());
|
||||
|
||||
@@ -196,6 +196,10 @@ protected:
|
||||
m_socket = lib::make_shared<socket_type>(
|
||||
_WEBSOCKETPP_REF(*service),lib::ref(*m_context));
|
||||
|
||||
if (m_socket_init_handler) {
|
||||
m_socket_init_handler(m_hdl, get_socket());
|
||||
}
|
||||
|
||||
m_io_service = service;
|
||||
m_strand = strand;
|
||||
m_is_server = is_server;
|
||||
@@ -245,10 +249,6 @@ protected:
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_socket_init_handler) {
|
||||
m_socket_init_handler(m_hdl,get_socket());
|
||||
}
|
||||
|
||||
callback(lib::error_code());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user