Hi,
      I need to send ip information of a client to the other one (as they will connect to each other directly now).
I used async echo server sample as a starting point.
I guess sessions are recorded in io_service instance, since in the server constructor when we create session, we pass io_service to it.
session* new_session = new session(io_service_);
Can I get information of connected sessions from io_service?
(or any other recommendations on how to better design it?)

To expand my question: I am implementing a chat server, but the chats will not go over the server (is it a bad idea?).
many clients connects, I keep their status (online or not) in a database.
when A wants to talk to B, I need to pass request to B, how can I get a handle to my connection to B while I am in the instance of session with A?

I am still not sure I understand io_service concept.
Is this proactor thing similar to observer pattern? When we pass io_service as a parameter to something, are we registering it to be observed in io_service?

Thanks in advance,
(Thanks for all the previous answers too, I have made significant progress...)

Best regards,
Ozgur (Oscar) Ozturk
www.DrOzturk.com
Phone: +1 (908) DROZGUR
i.e,        +1 (908) 376-9487