Logo
~Sockets~
~Examples~
~Contact~


FwdSocket Class Reference

This socket connects to the smtp server and forwards traffic from the smtp server back to the client. More...

#include <FwdSocket.h>

Collaboration diagram for FwdSocket:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FwdSocket (ISocketHandler &)
 ~FwdSocket ()
void OnLine (const std::string &)
void OnDelete ()
void SetRemote (SMTPSocket *p)

Private Attributes

SMTPSocketm_remote

Detailed Description

This socket connects to the smtp server and forwards traffic from the smtp server back to the client.

See also:
SMTPSocket

Definition at line 31 of file FwdSocket.h.


Constructor & Destructor Documentation

FwdSocket::FwdSocket ( ISocketHandler &   ) 

Definition at line 52 of file FwdSocket.cpp.

00053 :TcpSocket(h)
00054 ,m_remote(NULL)
00055 {
00056         SetLineProtocol();
00057 }

FwdSocket::~FwdSocket (  ) 

Definition at line 60 of file FwdSocket.cpp.

References m_remote.

00061 {
00062         if (m_remote && Handler().Valid(m_remote) )
00063         {
00064 //              m_remote -> SetCloseAndDelete();
00065         }
00066 }


Member Function Documentation

void FwdSocket::OnLine ( const std::string &   ) 

Definition at line 69 of file FwdSocket.cpp.

References m_remote.

00070 {
00071         Parse pa(line,"-");
00072         long status = pa.getvalue();
00073         if (status == 550)
00074         {
00075                 if (m_remote && Handler().Valid(m_remote) )
00076                 {
00077                         m_remote -> SetFake();
00078                 }
00079                 m_remote -> Send("250 Ok\r\n");
00080                 SetCloseAndDelete();
00081         }
00082         else
00083         if (status != 250)
00084         {
00085                 printf("<%s\n",line.c_str());
00086         }
00087         if (m_remote && Handler().Valid(m_remote) )
00088         {
00089                 m_remote -> Send(line + "\r\n");
00090         }
00091 }

void FwdSocket::OnDelete (  ) 

Definition at line 94 of file FwdSocket.cpp.

References m_remote.

00095 {
00096         if (m_remote && Handler().Valid(m_remote) )
00097         {
00098 //              m_remote -> SetCloseAndDelete();
00099         }
00100 }

void FwdSocket::SetRemote ( SMTPSocket p  )  [inline]

Definition at line 39 of file FwdSocket.h.

References m_remote.

00039 { m_remote = p; }


Member Data Documentation

Definition at line 42 of file FwdSocket.h.

Referenced by OnDelete(), OnLine(), SetRemote(), and ~FwdSocket().


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