Logo
~Sockets~
~Examples~
~Contact~


MyHandler Class Reference

List of all members.


Public Member Functions

 MyHandler (StdLog *p)
 ~MyHandler ()
void List (TcpSocket *p)
void SetQuit ()
bool Quit ()
void CheckHtml ()

Public Attributes

std::string m_html
bool m_ok
bool m_done

Private Attributes

bool m_quit

Detailed Description

Definition at line 21 of file sockets_test.cpp.


Constructor & Destructor Documentation

MyHandler::MyHandler ( StdLog *  p  )  [inline]

Definition at line 24 of file sockets_test.cpp.

00024 : SocketHandler(p),m_done(false),m_quit(false) {}

MyHandler::~MyHandler (  )  [inline]

Definition at line 25 of file sockets_test.cpp.

00025 {}


Member Function Documentation

void MyHandler::List ( TcpSocket *  p  )  [inline]

Definition at line 27 of file sockets_test.cpp.

00027                                 {
00028                 for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++)
00029                 {
00030                         Socket *p0 = (*it).second;
00031                         if (dynamic_cast<PoolSocket *>(p0))
00032                         {
00033                                 p -> Send("PoolSocket\n");
00034                         }
00035                         else
00036                         if (dynamic_cast<HttpGetSocket *>(p0))
00037                         {
00038                                 p -> Send("HttpGetSocket\n");
00039                         }
00040                         else
00041                         if (dynamic_cast<TcpSocket *>(p0))
00042                         {
00043                                 p -> Send("TcpSocket\n");
00044                         }
00045                         else
00046                         {
00047                                 p -> Send("Some kind of Socket\n");
00048                         }
00049                         bool r;
00050                         bool w;
00051                         bool e;
00052                         Handler().ISocketHandler_Get(p, r, w, e);
00053                         char slask[1000];
00054                         sprintf(slask,"  Read: %s  Write: %s  Exception: %s\n",
00055                                 r ? "SET" : "not set",
00056                                 w ? "SET" : "not set",
00057                                 e ? "SET" : "not set");
00058                         p -> Send( slask );
00059                 }
00060         }

void MyHandler::SetQuit (  )  [inline]

Definition at line 61 of file sockets_test.cpp.

References m_quit.

00061 { m_quit = true; }

bool MyHandler::Quit (  )  [inline]

Definition at line 62 of file sockets_test.cpp.

References m_quit.

Referenced by main().

00062 { return m_quit; }

void MyHandler::CheckHtml (  )  [inline]

Definition at line 63 of file sockets_test.cpp.

References m_done, m_html, and m_ok.

00063                          {
00064                 if (m_done)
00065                 {
00066                         if (m_ok)
00067                                 printf("Html OK:\n%s\n", m_html.c_str());
00068                         else
00069                                 printf("Html Failed\n");
00070                         m_done = false;
00071                 }
00072         }


Member Data Documentation

std::string MyHandler::m_html

Definition at line 74 of file sockets_test.cpp.

Referenced by CheckHtml().

Definition at line 75 of file sockets_test.cpp.

Referenced by CheckHtml().

Definition at line 76 of file sockets_test.cpp.

Referenced by CheckHtml().

bool MyHandler::m_quit [private]

Definition at line 79 of file sockets_test.cpp.

Referenced by Quit(), and SetQuit().


The documentation for this class was generated from the following file:
Page, code, and content Copyright (C) 2007 by Anders Hedström
Generated for C++ Sockets by  doxygen 1.4.4