Boost logo

Boost :

From: Scott (cheesy4poofs_at_[hidden])
Date: 2006-07-13 17:00:50


Hey Chris,

>Is your program single or multithreaded? Any chance you can boil
>it down to a test program? What version of OpenSSL are you
>using?

It's multithreaded. On the client side, we have one thread that basically
starts in the io_service::run() method. Before starting the thread, we
attach a async_read() callback handler then start the thread. When the
thread receives data, it stores all messages in a global map (locked from a
mutex), that all threads have access to. Messages can be received by an
application defined message id. After each message is received, it
reattaches the async_read() callback handler so the io_service never runs
out of work to do.

Other threads in the client such as the UI thread share the same socket and
can send requests thru the socket. However all replies are handled by the
receiver thread. There are other threads as well, but they don't really
interact with ASIO.

Server

The server creates multiple threads to listen for incoming connections. At
the end of each ThreadEntry() func is a call to a shared global
asio::io_service::run(). These threads do typical server things such as
handle incoming requests and send back responses.

We also have other threads that are constantly running. As an example,
there's a thread that monitors CPU performance. Clients can request a
monitor be placed on the CPU activity level and when it changes this thread
will immediately send data to client on the change. This is not a typical
request/response scenario as the data will be sent to the client at random
intervals (as far as the client is concerned) without a corresponding
request (other than the initial monitor request).

Given some of the scenarios I've described above, do you seen any
implementation issues? OpenSSL version is 0.9.8a. I'll attempt to modify
the included ASIO SSL example program to better mimic some of the processes
we have running. :)

Thanks,
Scott


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk