Logo
~Sockets~
~Examples~
~Contact~


Stdin2 Class Reference

#include <Stdin2.h>

Inheritance diagram for Stdin2:

Inheritance graph
[legend]
Collaboration diagram for Stdin2:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Stdin2 (ISocketHandler &)
void OnData (const char *, size_t)
void SetIcmpSocket (ICMPTwistSocket *p)
void OnOptions (int, int, int, SOCKET)

Private Attributes

ICMPTwistSocketm_pICMPSocket

Detailed Description

Definition at line 32 of file Stdin2.h.


Constructor & Destructor Documentation

Stdin2::Stdin2 ( ISocketHandler &  h  ) 

File ......... Stdin2.cpp Published .... 2004-07-03 Author ....... grymse@alhem.net

Definition at line 32 of file Stdin2.cpp.

00032                                 : Stdin(h)
00033 ,m_pICMPSocket(NULL)
00034 {
00035 }


Member Function Documentation

void Stdin2::OnData ( const char *  ,
size_t   
) [virtual]

characters from stdin, including crlf's

Implements Stdin.

Definition at line 38 of file Stdin2.cpp.

References m_pICMPSocket.

00039 {
00040         char buf[1000];
00041         strncpy(buf, p, len);
00042         buf[len] = 0;
00043         while (strlen(buf) && (buf[strlen(buf) - 1] == 13 || buf[strlen(buf) - 1] == 10))
00044                 buf[strlen(buf) - 1] = 0;
00045         //printf("Console(%d bytes): %s\n", n, buf);
00046         if (m_pICMPSocket)
00047         {
00048                 m_pICMPSocket -> Send( buf );
00049         }
00050 }

void Stdin2::SetIcmpSocket ( ICMPTwistSocket p  )  [inline]

Definition at line 38 of file Stdin2.h.

References m_pICMPSocket.

Referenced by main().

00038 { m_pICMPSocket = p; }

void Stdin2::OnOptions ( int  ,
int  ,
int  ,
SOCKET   
) [inline]

Definition at line 40 of file Stdin2.h.

00040 {}


Member Data Documentation

Definition at line 43 of file Stdin2.h.

Referenced by OnData(), and SetIcmpSocket().


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