Logo
~Sockets~
~Examples~
~Contact~


InternalSocket Class Reference

#include <InternalSocket.h>

Collaboration diagram for InternalSocket:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 InternalSocket (ISocketHandler &, SlaveSocket *, unsigned short id)
 ~InternalSocket ()
void OnConnect ()
void OnDelete ()
void OnRawData (const char *, size_t)
unsigned short GetID ()

Private Member Functions

 InternalSocket (const InternalSocket &s)
InternalSocketoperator= (const InternalSocket &)

Private Attributes

SlaveSocketm_parent
unsigned short m_id

Detailed Description

Definition at line 10 of file InternalSocket.h.


Constructor & Destructor Documentation

InternalSocket::InternalSocket ( ISocketHandler &  ,
SlaveSocket ,
unsigned short  id 
)

Definition at line 6 of file InternalSocket.cpp.

00007 :TcpSocket(h)
00008 ,m_parent(p)
00009 ,m_id(id)
00010 {
00011 }

InternalSocket::~InternalSocket (  ) 

Definition at line 14 of file InternalSocket.cpp.

00015 {
00016 }

InternalSocket::InternalSocket ( const InternalSocket s  )  [inline, private]

Definition at line 23 of file InternalSocket.h.

00023 : TcpSocket(s) {} // copy constructor


Member Function Documentation

void InternalSocket::OnConnect (  ) 

Definition at line 31 of file InternalSocket.cpp.

References m_id, m_parent, and S2M_CONNECT.

00032 {
00033         if (Handler().Valid(m_parent))
00034         {
00035                 m_parent -> SendCmd(m_id, S2M_CONNECT);
00036         }
00037 }

void InternalSocket::OnDelete (  ) 

Definition at line 40 of file InternalSocket.cpp.

References m_id, m_parent, and S2M_DISCONNECTED.

00041 {
00042         if (Handler().Valid(m_parent))
00043         {
00044                 m_parent -> SendCmd(m_id, S2M_DISCONNECTED);
00045         }
00046 }

void InternalSocket::OnRawData ( const char *  ,
size_t   
)

Definition at line 19 of file InternalSocket.cpp.

References m_id, m_parent, and S2M_DATA.

00020 {
00021 printf("InternalSocket::OnRawData size %u\n", len);
00022         if (Handler().Valid(m_parent))
00023         {
00024                 m_parent -> SendCmd(m_id, S2M_DATA, len);
00025                 m_parent -> SendBuf(buf, len);
00026         }
00027         ibuf.Remove(ibuf.GetLength());
00028 }

unsigned short InternalSocket::GetID (  )  [inline]

Definition at line 20 of file InternalSocket.h.

References m_id.

00020 { return m_id; }

InternalSocket& InternalSocket::operator= ( const InternalSocket  )  [inline, private]

Definition at line 24 of file InternalSocket.h.

00024 { return *this; } // assignment operator


Member Data Documentation

Definition at line 25 of file InternalSocket.h.

Referenced by OnConnect(), OnDelete(), and OnRawData().

unsigned short InternalSocket::m_id [private]

Definition at line 26 of file InternalSocket.h.

Referenced by GetID(), OnConnect(), OnDelete(), and OnRawData().


The documentation for this class was generated from the following files:
Page, code, and content Copyright (C) 2006 by Anders Hedström
Generated on Mon Aug 29 20:21:47 2005 for C++ Sockets by  doxygen 1.4.4