Boost logo

Boost Users :

Subject: Re: [Boost-users] getting a handle to another connection?
From: Etienne Philip Pretorius (icewolfhunter_at_[hidden])
Date: 2009-07-27 12:51:22


Ozgur Ozturk wrote:
>> I used async echo server sample
>>
> <http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp>as
> a starting point.
>
>> ...
>> Can I get information of connected sessions from io_service?
>> (or any other recommendations on how to better design it?)
>>
>
> Maybe I should keep a global array of sessions, instead of creating it with
> a pointer
> session* new_session
>
>
You could use shared_ptr to avoid having to write a copy
constructor/assignment operator and all those other 'evil' things.

> is this a bad idea?
>
> It seems like in the current code ONLY ONE session pointer is passed around.
> I had thought (from the name "session") there would be a session per
> connection?
>
> Thanks again,
> Ozgur Ozturk
> www.DrOzturk.com
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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