stool::basic_connection< istream_t, ostream_t > Class Template Reference

#include <connection.h>

Inheritance diagram for stool::basic_connection< istream_t, ostream_t >:

stool::connection_base

List of all members.

template<class istream_t, class ostream_t>
class stool::basic_connection< istream_t, ostream_t >


Public Member Functions

virtual void run (istream_t &in, ostream_t &out) const
virtual void run (istream_t &in) const
virtual void run (ostream_t &out) const

Protected Member Functions

void run (socket_t socket) const
void runin (socket_t socket) const
void runout (socket_t socket) const

Member Function Documentation

template<class istream_t, class ostream_t>
virtual void stool::basic_connection< istream_t, ostream_t >::run ( istream_t &  in,
ostream_t &  out 
) const [inline, virtual]

Implement the run(istream&, ostream&) to handle connections on the server. Either sub class the connection_base directly or use one of the provided sub classes or connection_handler classes to handle new client connections. For the thread_single and thread_multi threading models, you override this function and send data to the client through the out stream and receive data through the in stream. If you need to handle in and out in separate threads, use the thread_multisplit and implement the two separate functions run(istream&) and run(ostream&). The default implementation doesn't do anything, it will immediately exit and shut down the connection.

Parameters:
in The input stream for the connection. This is connected to the remote client's output stream.
out The output stream for the connection. This is connected to the remote client's input stream.

template<class istream_t, class ostream_t>
virtual void stool::basic_connection< istream_t, ostream_t >::run ( istream_t &  in  )  const [inline, virtual]

Override this when using the thread_multisplit model. The run(std::istream&) and the run(std::ostream&) will both be called when using the the thread_multisplit model. Each of them are called by a seperate thread. Care must be taken to check for concurrency issues when using the multithreaded models. When both run() functions have returned the connection will be shut down.

Parameters:
in The input stream for the connection. This is connected to the remote client's output stream.

template<class istream_t, class ostream_t>
virtual void stool::basic_connection< istream_t, ostream_t >::run ( ostream_t &  out  )  const [inline, virtual]

Override this when using the thread_multisplit model The run(std::istream&) and the run(std::ostream&) will both be called when using the the thread_multisplit model. Each of them are called by a seperate thread. Care must be taken to check for concurrency issues when using the multithreaded models. When both run() functions have returned the connection will be shut down.

Parameters:
out The output stream for the connection. This is connected to the remote client's input stream.

template<class istream_t, class ostream_t>
void stool::basic_connection< istream_t, ostream_t >::run ( socket_t  socket  )  const [inline, protected, virtual]

template<class istream_t, class ostream_t>
void stool::basic_connection< istream_t, ostream_t >::runin ( socket_t  socket  )  const [inline, protected, virtual]

template<class istream_t, class ostream_t>
void stool::basic_connection< istream_t, ostream_t >::runout ( socket_t  socket  )  const [inline, protected, virtual]


The documentation for this class was generated from the following file:
Follow @ClearObjects