mm.w
2016-02-08 17:21:23 UTC
Hello,
in general, the parent thread must exist first in order to create the child
thread. You are blocking the main-thread except polling nothing can happen
; it will sit there until it can be signaled, you don't have the necessary
code to handle this particular case, basically hijacking the main-loop is
always tricky. You must have a client worker thread.
--> main_loop != your network loop
https://en.wikipedia.org/wiki/Event_loop
Best.
c.send()
that will initiate a aync_write from client side. The cout in this method
is however never reached. > Why is it never called if it's not the
async_read that is 'blocking' the code?
in general, the parent thread must exist first in order to create the child
thread. You are blocking the main-thread except polling nothing can happen
; it will sit there until it can be signaled, you don't have the necessary
code to handle this particular case, basically hijacking the main-loop is
always tricky. You must have a client worker thread.
--> main_loop != your network loop
https://en.wikipedia.org/wiki/Event_loop
Best.
Both client::handshakeCallback and server::handshakeCallback issue
async_read, but neither issues an async_write.
But if you take a look at the main method you can see I'm callingasync_read, but neither issues an async_write.
c.send()
that will initiate a aync_write from client side. The cout in this method
async_read that is 'blocking' the code?
Best regards,
Sandra
Sandra