Boost logo

Boost Users :

Subject: [Boost-users] [Asio]About aync_write and socket.close()
From: victor (victor.boost.program_at_[hidden])
Date: 2009-11-13 05:22:15


Hi,All
    io_service_.run() in itself thread. I initial socket with it , like
"socket_(io_service_)" . Then I read data from this socket in io_service
thread.
    Now if i want call "async_write " to this socket in another thread, do I
must use "io_service_.post( boost::bind function which call async_write)",
or can I call async_write directly?
    And if i want close this socket, do I must use "io_service_.post(..)" ,
or can I use "socket_.close()" directly in another thread?

   thanks



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net