
please wait
start_accept()
and a new object of session
is created where the packets are recieved and sent back but how exactly does the "handler" stuff work?handle_handshake(...)
, handle_read(...)
and handle_write(...)
doing and where are they called? What confuses me most is that in handle_read(...)
, async_write(..)
is called and in handle_write(...)
, socket_.async_read_some(..)
which seems kind of contradictory to me.handle_write
in the SSL example I posted is doing since handle_read
already does the packet sending.handle_read()
and handle_write()
are completion even handlers. A typical asynchronous write proceeds is as follows:async_write()
with a socket.io_service
object.io_service
object uses the underlying platform facilities to initiate the asynchronous write.io_service::run()
to a. wait for the asynchronous write to complete and b. the result of the asynchronous write to be retrieved.io_service
object waits for the asynchronous write to complete (if it is still incomplete) and calls the completion event handler - in this case handle_write()
- when the write completes.handle_write()
issues the next async_read request.async_write()
io_service::run()
on the associated io_service
object.handle_write()
is called, issue the async_write()
for the second packet.write()
A typical asynchronous write proceeds is as follows: |
handle_read()
and handle_write()
are actually calling each other once they complete that means it keeps the "packet checking" alive or am I missing something here?