Logo
~Sockets~
~Examples~
~Contact~


OutSocket Class Reference

#include <OutSocket.h>

Collaboration diagram for OutSocket:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OutSocket (ISocketHandler &h)
 ~OutSocket ()
void SetRemote (InSocket *p)
void OnDelete ()
void OnRawData (const char *, size_t)
void OnConnect ()

Private Attributes

InSocketm_remote

Detailed Description

Definition at line 27 of file OutSocket.h.


Constructor & Destructor Documentation

OutSocket::OutSocket ( ISocketHandler &  h  ) 

Definition at line 28 of file OutSocket.cpp.

00029 :TcpSocket(h, 32000, 32000)
00030 ,m_remote(NULL)
00031 {
00032 }

OutSocket::~OutSocket (  ) 

Definition at line 35 of file OutSocket.cpp.

00036 {
00037 }


Member Function Documentation

void OutSocket::SetRemote ( InSocket p  )  [inline]

Definition at line 33 of file OutSocket.h.

References m_remote.

00033 { m_remote = p; }

void OutSocket::OnDelete (  ) 

Definition at line 40 of file OutSocket.cpp.

References m_remote.

00041 {
00042         if (Handler().Valid(m_remote))
00043         {
00044                 m_remote -> SetCloseAndDelete();
00045         }
00046 }

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

Definition at line 49 of file OutSocket.cpp.

References m_remote.

00050 {
00051         if (Handler().Valid(m_remote))
00052         {
00053                 m_remote -> SendBuf(p, l);
00054         }
00055         else
00056         {
00057                 Handler().LogError(this, "OnRawData", 0, "m_remote not valid");
00058         }
00059 }

void OutSocket::OnConnect (  ) 

Definition at line 62 of file OutSocket.cpp.

References m_remote.

00063 {
00064         if (Handler().Valid(m_remote))
00065         {
00066                 if (m_remote -> tmpl)
00067                 {
00068                         printf("Sending %d early bytes\n",m_remote -> tmpl);
00069                         SendBuf(m_remote -> tmps, m_remote -> tmpl);
00070                         m_remote -> tmpl = 0;
00071                 }
00072         }
00073 }


Member Data Documentation

Definition at line 41 of file OutSocket.h.

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


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