<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user">
    <title>gmane.comp.lib.boost.asio.user</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5238"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5237"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5236"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5235"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5234"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5233"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5232"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5231"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5230"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5229"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5228"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5227"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5226"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5225"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5224"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5223"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5222"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5221"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5220"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5219"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5238">
    <title>Re: thread::interrupt and asio::ios_service::run</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5238</link>
    <description>&lt;pre&gt;
which btw is my goal, i use interrupt for controlled cleanup and quit


That is wrong. There are defined cancelation points. If thread avoids
them there is no chance it will be cancelled. Also
boost::thread::interrupt results in exception, not cancellation in
sense of pthread_cancel.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
asio-users mailing list
asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio

&lt;/pre&gt;</description>
    <dc:creator>kir</dc:creator>
    <dc:date>2012-05-17T15:51:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5237">
    <title>Re: thread::interrupt and asio::ios_service::run</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5237</link>
    <description>&lt;pre&gt;Quoting "Gruenke, Matt" &amp;lt;mgruenke-5gPrpW63zFhBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;:

I think not liking it is a mild reaction. Hate or despise is a more appropriate
response.  I would go so far as to say it is not possible to use it correctly.

The only safe thing to do after cancelling a thread is to kill the entire
process.  Sure things may work by accident most of the time, but cancelling a
thread inherently leaves any resources that thread was using in an unstable
state.

Dale



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
asio-users mailing list
asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists&lt;/pre&gt;</description>
    <dc:creator>Dale Wilson</dc:creator>
    <dc:date>2012-05-17T13:46:51</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5236">
    <title>Re: thread::interrupt and asio::ios_service::run</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5236</link>
    <description>&lt;pre&gt;
Just to be clear, *I* never said it didn't.  Maybe it does with one narrow exception that you hit.  I just tried to make my case against thread::interrupt().  I've never liked it, or pthread_cancel(), for that matter.
 

Matt


________________________________

From: kir
Sent: Thu 5/17/2012 1:18 AM
To: asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
Subject: Re: [asio-users] thread::interrupt and asio::ios_service::run



On Wed, May 16, 2012 at 7:43 PM, Gruenke, Matt &amp;lt;mgruenke-1xCVI8+nB4ZBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:


That would work. But i will have extra thread per server object. It is
tolerable as this thread always sleeps and there is no memory limit. I
instead created global ioSvc and added stop to main just before exit
sequence is initiated. And your solution is local, so i will go with
it at some point. Thanks again. Still puzzled why asio does not
support interruption by itself.

------------------------------------------------------------------------------
Live Security Virtua&lt;/pre&gt;</description>
    <dc:creator>Gruenke, Matt</dc:creator>
    <dc:date>2012-05-17T06:44:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5235">
    <title>Re: thread::interrupt and asio::ios_service::run</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5235</link>
    <description>&lt;pre&gt;

That would work. But i will have extra thread per server object. It is
tolerable as this thread always sleeps and there is no memory limit. I
instead created global ioSvc and added stop to main just before exit
sequence is initiated. And your solution is local, so i will go with
it at some point. Thanks again. Still puzzled why asio does not
support interruption by itself.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
asio-users mailing list
asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio?&lt;/pre&gt;</description>
    <dc:creator>kir</dc:creator>
    <dc:date>2012-05-17T05:18:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5234">
    <title>Re: thread::interrupt and asio::ios_service::run</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5234</link>
    <description>&lt;pre&gt;already has kind of
thread::interrupt. I already
modifications.

What if you created a thread that existed simply to translate the
thread::interrupt() into io_service::stop()?

Something like this:

        // global, for the sake of brevity
    boost::asio::io_service IoSvc;

    void IoSvc_threadmain()
    {
        IoSvc.run();
    }

    void IoSvc_glue_threadmain()
    {
        boost::thread iosvc_thread(IoSvc_threadmain);
        try {
            iosvc_thread.join();
        }
        catch (boost::thread_interrupted &amp;amp; exn)
        {
            IoSvc.stop();
            iosvc_thread.join();
        }
    }


Then, the thread running IoSvc_glue_threadmain() is the only one visible
to the 3rd party code.


Matt


-----Original Message-----
From: kir 
Sent: Tuesday, May 15, 2012 21:32
To: asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
Subject: Re: [asio-users] thread::interrupt and asio::ios_service::run

On Wed, May 16, 2012 at 4:31 AM, Gruenke, Matt &amp;lt;mgruenke-1xCVI8+nB4ZBDgjK7y7TUQ&amp;lt; at &amp;gt;publ&lt;/pre&gt;</description>
    <dc:creator>Gruenke, Matt</dc:creator>
    <dc:date>2012-05-16T15:43:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5233">
    <title>Boost/Asio "short read" error</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5233</link>
    <description>&lt;pre&gt;Hi,
I have problem with asio - sometimes server returns "short read" error.
I'm using client/server from the examples, I have boost 1.49, Windows 7 64 bit (application is 64 bit).
Please write me - is it just a bug or wrong implemented example inside of boost because the error occurs not every time.
How to protect my application against the error?
I tried to ask in boost mailing list but without result.
It is extremely important to me to determine what cause the error.
Best regards,
Marcin Głogowski

Dom Maklerski Banku Ochrony Środowiska Spółka Akcyjna
ul. Marszałkowska 78/80 / 00-517 Warszawa

wpisana w Rejestrze Przedsiębiorców prowadzonym przez
Sąd Rejonowy dla m. st. Warszawy XII Wydział Gospodarczy Krajowego Rejestru Sądowego
pod numerem: KRS 0000048901 / NIP 526-10-26-828

Kapitał zakładowy w wysokości 21.551.200zł wpłacony w całości.

P - Nie drukuj tej wiadomości, jeśli to nie jest konieczne.
------------------------------------------------------------------------------
Live Secur&lt;/pre&gt;</description>
    <dc:creator>Marcin Głogowski</dc:creator>
    <dc:date>2012-05-16T09:55:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5232">
    <title>Re: thread::interrupt and asio::ios_service::run</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5232</link>
    <description>&lt;pre&gt;
i need to add asio-based server into other's person program wich
already has kind of cancel-all-threads-and-gracefully-exit code based
on thread::interrupt. I already used ::stop as you suggested although
it required non-local modifications.


sorry for that, looks like valgrind complained beyond main (in
destructor of global object), so i guess it is UB anyway. Will check
again later.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
asio-users mailing list
asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/asio-users
______________________________________________&lt;/pre&gt;</description>
    <dc:creator>kir</dc:creator>
    <dc:date>2012-05-16T01:32:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5231">
    <title>Re: thread::interrupt and asio::ios_service::run</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5231</link>
    <description>&lt;pre&gt;I don't know if it's intended.  I'm just saying the bar for correctly
implementing interruption support is a lot higher than stop.  It's easy
to see, through testing &amp;amp; inspection, that stop() works correctly, but
that's much less true of interrupt().  If you don't need interrupt(),
I'd advise you to avoid it.

BTW, I assume the only reason someone would need interrupt() is to
seamlessly cancel threads, whether or not they're driving an
io_service() at the time.  Otherwise, I'm puzzled.  The primary benefit
of interrupt() is that it cancels blocking operation.  However, since
the point of io_service is to perform nonblocking operations, it's not
clear to me what you hope to gain by it.  If because your completion
handlers are blocking for significant amounts of time, you should be
aware that doing so may cause you other problems.


I can't answer for the valgrind problem you found.  If you're able to
find the underlying cause (or at least verify that it's not a problem
with your test), please submit it to the&lt;/pre&gt;</description>
    <dc:creator>Gruenke, Matt</dc:creator>
    <dc:date>2012-05-16T00:31:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5230">
    <title>Re: thread::interrupt and asio::ios_service::run</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5230</link>
    <description>&lt;pre&gt;
So is it intended behavior? Is it so hard to support or is it a design
decision? (my handlers already support interruption, everything could
be just fine if io_service also did)


I'll have to have global storage for them in my case or maybe one
global service. But anyway thanks for quick answer.


As a side note i started from valgrind reporting invalid read around
epoll_reactor.ipp:364 (boost 1.47) which looks like this:

#if defined(BOOST_ASIO_HAS_TIMERFD)
  bool check_timers = (timer_fd_ == -1);
#else // defined(BOOST_ASIO_HAS_TIMERFD)

But it has gone when i stripped example to minimum. I mean it may be a
design decision but still must not produce invalid reads.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://&lt;/pre&gt;</description>
    <dc:creator>kir</dc:creator>
    <dc:date>2012-05-15T23:43:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5229">
    <title>Re: thread::interrupt and asio::ios_service::run</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5229</link>
    <description>&lt;pre&gt;Not only would io_service need to support this, but so would every
handler you use, since the thread(s) calling io_service::run() are the
ones actually calling them.

I'd recommend directly calling io_service::stop().  Depending on your
aim, you might do even better to shut down all the state machines using
your io_service, causing it to exit simply by depriving it of work.


Matt


-----Original Message-----
From: kir
Sent: Tuesday, May 15, 2012 18:50
To: asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
Subject: [asio-users] thread::interrupt and asio::ios_service::run

Hello all,

Sorry if it is very basic, jsut could not find an answer. Does
io_service::run supports boost::thread::interrupt?

I wrote small example which i expected to work, but it does not (prints
"interrupting" and exits, second thread does not exit at all):

#include &amp;lt;boost/thread.hpp&amp;gt;
#include &amp;lt;boost/asio.hpp&amp;gt;
#include &amp;lt;iostream&amp;gt;

void hello_timer (boost::system::error_code const &amp;amp;ec) { std::cerr &amp;lt;&amp;lt;
"timer\n"; }

void ios_ru&lt;/pre&gt;</description>
    <dc:creator>Gruenke, Matt</dc:creator>
    <dc:date>2012-05-15T23:03:07</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5228">
    <title>thread::interrupt and asio::ios_service::run</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5228</link>
    <description>&lt;pre&gt;Hello all,

Sorry if it is very basic, jsut could not find an answer. Does
io_service::run supports boost::thread::interrupt?

I wrote small example which i expected to work, but it does not
(prints "interrupting" and exits, second thread does not exit at all):

#include &amp;lt;boost/thread.hpp&amp;gt;
#include &amp;lt;boost/asio.hpp&amp;gt;
#include &amp;lt;iostream&amp;gt;

void hello_timer (boost::system::error_code const &amp;amp;ec) { std::cerr &amp;lt;&amp;lt;
"timer\n"; }

void ios_run (boost::asio::io_service *ios)
{
   try
   {
      ios-&amp;gt;run ();
      std::cerr &amp;lt;&amp;lt; "thread quit\n";
   }
   catch (std::exception const &amp;amp;e)
   {
      std::cerr &amp;lt;&amp;lt; "exception: " + std::string (e.what ()) + "\n";
   }
}

int main ()
{
   boost::asio::io_service ios;
   boost::asio::deadline_timer dt (ios);
   dt.expires_from_now (boost::posix_time::minutes (15));
   dt.async_wait (hello_timer);
   boost::thread t (boost::bind (ios_run, &amp;amp;ios));
   sleep (1);
   std::cerr &amp;lt;&amp;lt; "interrupting\n"; t.interrupt (); sleep (1);
   return 0;
}

--------------------------------------------------&lt;/pre&gt;</description>
    <dc:creator>kir</dc:creator>
    <dc:date>2012-05-15T22:50:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5227">
    <title>Re: Can we mix synchronous accept, connect and handshake (ssl) with async read and write on the same io_service</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5227</link>
    <description>&lt;pre&gt;That's Awesome, Joakim.  It is the OpenSSL callback initialization!  In
fact, I have to setup BOTH the static initialize and the dynamic initialize
callbacks due to the large # of threads dynamically created at runtime
based on the zillions events we are handling.  The process has been running
for hours without any hick ups.  Thanks!

I also adopted Matt's idea about having a timer with the renewed timestamp
to save the hassle of canceling and creating.  All is well so far!

Thanks to all!

- Rene

On Mon, May 14, 2012 at 11:04 PM, &amp;lt;joakim-GNV4AyBOGYU&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/____________________________________________&lt;/pre&gt;</description>
    <dc:creator>Rene Zhu</dc:creator>
    <dc:date>2012-05-15T21:17:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5226">
    <title>Re: shared libraries problem (linux only)</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5226</link>
    <description>&lt;pre&gt;I didn't see the original message in this thread, but I wanted to point
out that any code relying on RTTI, such as dynamic_cast&amp;lt;&amp;gt; or exception
handling, can malfunction when applied to objects created on the other
side of the boundary between a runtime-loaded shared library (i.e.
loaded using dlopen()) and the program that loaded it (or other
runtime-loaded shared libraries).

Even if Boost.Asio doesn't use such features directly, any other
libraries it uses or that are used in conjunction with it, that rely on
these features, could cause apparent malfunctions in Boost.Asio.

So, if you have some sort of "plug-in" mechanism in your program, you're
advised to think hard about the data types passed across that interface.
Virtual functions are fine (assuming compatible versions of the class),
but don't expect to handle any exceptions thrown by the other side.


Matt


-----Original Message-----
From: Rogerio Pontual 
Sent: Tuesday, May 15, 2012 13:46
To: asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.&lt;/pre&gt;</description>
    <dc:creator>Gruenke, Matt</dc:creator>
    <dc:date>2012-05-15T18:27:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5225">
    <title>Re: shared libraries problem (linux only)</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5225</link>
    <description>&lt;pre&gt;

Hi Berserker,

I'm facing a similar problem trying to execute a cross-compiled (for mipsel) 
simple example from boost: 
http://www.boost.org/doc/libs/1_46_1/doc/html/boost_asio/example/http/client/asy
nc_client.cpp

I've tried using either -DBOOST_ASIO_DISABLE_EPOLL or -
DBOOST_ASIO_DISABLE_EVENTFD, and both. Without -DBOOST_ASIO_DISABLE_EPOLL, I'm 
getting a hanging epoll_wait while if EPOLL is disabled, boost is instrumented 
with select, and strace shows a _newselect syscall with tv_sec timeout parameter 
equal to 300 seconds.

Could you overcome the io_service::run freeze? I'd appreciate a lot to hear how 
this issue has unfolded for you.

Best Regards,
Roger


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://w&lt;/pre&gt;</description>
    <dc:creator>Rogerio Pontual</dc:creator>
    <dc:date>2012-05-15T17:46:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5224">
    <title>Re: Can we mix synchronous accept, connect and handshake (ssl) with async read and write on the sameio_service</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5224</link>
    <description>&lt;pre&gt;OpenSSL is not thread-safe per default. You have to make it thread safe by supplying locking callback functions to it. If you have not done this, that might be the cause of your crashes. I do not think only using strands will be sufficient, the ssl library itself needs to be thread safe.

Joakim
________________________________
From: Gruenke, Matt [mailto:mgruenke-5gPrpW63zFhBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org]
Sent: den 15 maj 2012 02:01
To: asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
Subject: Re: [asio-users] Can we mix synchronous accept, connect and handshake (ssl) with async read and write on the same io_service

I have no experience with SSL, but it sounds like the way you're using the timer might be problematic.

Here's what I'd do:

1.       Make a strand for each connection

2.       Post perform_handshake() to the strand

3.       Create a timer per connection and call async_wait(), with the handler being posted to the strand.  Rather than continually cancel &amp;amp; reschedule the timer, I'd ju&lt;/pre&gt;</description>
    <dc:creator>joakim-GNV4AyBOGYU&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2012-05-15T06:04:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5223">
    <title>Re: Can we mix synchronous accept,connect and handshake (ssl) with async read and write on the sameio_service</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5223</link>
    <description>&lt;pre&gt;I have no experience with SSL, but it sounds like the way you're using
the timer might be problematic.

 

Here's what I'd do:

1.       Make a strand for each connection

2.       Post perform_handshake() to the strand

3.       Create a timer per connection and call async_wait(), with the
handler being posted to the strand.  Rather than continually cancel &amp;amp;
reschedule the timer, I'd just keep a timestamp of the next deadline.
In the timer's handler, you check the timestamp.  If the timestamp is in
the past, teardown the connection or whatever.  If the timestamp is in
the future, use that time for your next async_wait().

4.       async_read()/async_write() should post their handlers to the
strand.  Each of these handlers can update the timestamp used by the
timer.  Or maybe you have separate timestamps for each, depending on
their meaning/purpose.

 

 

Matt

 

 

From: Rene Zhu
Sent: Friday, May 11, 2012 15:23
To: asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
Subject: [asio-users] Can we &lt;/pre&gt;</description>
    <dc:creator>Gruenke, Matt</dc:creator>
    <dc:date>2012-05-15T00:00:43</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5222">
    <title>Re: creating a match object that stops at a character other than a newline</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5222</link>
    <description>&lt;pre&gt;
After some investigation into programming terminals  I added this
block of code to the start of my program and now the whole thing
behaves as I want it to (i.e. I get a callback on a '?')

    if (tcgetattr(STDIN_FILENO, &amp;amp;term) == -1)
        return -1;
    //disable canonical mode
    term.c_lflag &amp;amp;= ~ICANON;
    term.c_cc[VMIN] = 1;
    term.c_cc[VTIME] = 0;

    if (tcsetattr(STDIN_FILENO, TCSANOW, &amp;amp;term) == -1)
        return -1;

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
asio-users mailing list
asio-users&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/asio-users
__________________________&lt;/pre&gt;</description>
    <dc:creator>Sashan Govender</dc:creator>
    <dc:date>2012-05-14T13:47:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5221">
    <title>Re: creating a match object that stops at a character other than a newline</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5221</link>
    <description>&lt;pre&gt;
I think it's just my expectation of the terminal/stdin behaviour
that's wrong. I created an input io service mapped to stdin,
implemented a match condition with a '?' terminator, and expected that
it would callback when I typed '?' on the keyboard.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
asio-users mailing list
asio-users&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio
&lt;/pre&gt;</description>
    <dc:creator>Sashan Govender</dc:creator>
    <dc:date>2012-05-14T11:51:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5220">
    <title>Re: creating a match object that stops at a character other than a newline</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5220</link>
    <description>&lt;pre&gt;On Sun, 2012-05-13 at 20:21 +1000, Sashan Govender wrote: 

If you are using telnet or nc to test, realise they won't send any data
to the application until you press enter, they are terminal applications
after all.

You can try sending a line with a '?' in the middle, then observe that
your application reads more data after it finds the '?'.  Or you may
want to write your own application to send a byte immediately after a
key press.



&lt;/pre&gt;</description>
    <dc:creator>Nick Jones</dc:creator>
    <dc:date>2012-05-14T00:42:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5219">
    <title>Re: creating a match object that stops at a character other than a newline</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5219</link>
    <description>&lt;pre&gt;

FWIW, I tried your code and it worked as expected. I use boost 1.49,
MSVC10, Win7.
(The only change I did was commenting-out BOOST_LOG_TRIVIAL line.)
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
asio-users mailing list
asio-users&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio
&lt;/pre&gt;</description>
    <dc:creator>Igor R</dc:creator>
    <dc:date>2012-05-13T11:14:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5218">
    <title>creating a match object that stops at a characterother than a newline</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.boost.asio.user/5218</link>
    <description>&lt;pre&gt;Hi

How do you create a match functor that stops at a character other than
a newline? I tried this

class DetectTerminator
{
    public:
        explicit DetectTerminator() {}

        template &amp;lt;typename Iterator&amp;gt;
            std::pair&amp;lt;Iterator, bool&amp;gt; operator()(
                    Iterator begin, Iterator end) const
            {
                Iterator i = begin;
                while (i != end)
                {
                    if ('\n' == *i || '?' == *i)
                    {
                        BOOST_LOG_TRIVIAL(info) &amp;lt;&amp;lt; "detected " &amp;lt;&amp;lt; int(*i);
                        return std::make_pair(i, true);
                    }
                    else
                    {
                        i++;
                    }
                }
                return std::make_pair(i, false);
            }
};
namespace boost { namespace asio {
  template &amp;lt;&amp;gt; struct is_match_condition&amp;lt;DetectTerminator&amp;gt;
    : public boost::true_type {};
} }


but it doesn't callback to the read completion handler when a '&lt;/pre&gt;</description>
    <dc:creator>Sashan Govender</dc:creator>
    <dc:date>2012-05-13T10:21:16</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lib.boost.asio.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lib.boost.asio.user</link>
  </textinput>
</rdf:RDF>

