Logo
~Sockets~
~Examples~
~Contact~


icm.cpp

Go to the documentation of this file.
00001 
00006 /*
00007 Copyright (C) 2004  Anders Hedstrom
00008 Parts Copyright (c) Vergil of Ragestorm.net, 2003
00009 
00010 This program is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU General Public License
00012 as published by the Free Software Foundation; either version 2
00013 of the License, or (at your option) any later version.
00014 
00015 This program is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with this program; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 */
00024 #include <SocketHandler.h>
00025 #include <StdoutLog.h>
00026 #include "Stdin2.h"
00027 #include "ICMPTwistSocket.h"
00028 
00029 
00030 int main(int argc,char *argv[])
00031 {
00032         SocketHandler h;
00033         StdoutLog log;
00034         h.RegStdLog(&log);
00035         Stdin2 console(h);
00036         ICMPTwistSocket s(h);
00037 
00038         if (s.GetSocket() == INVALID_SOCKET)
00039         {
00040                 return -1;
00041         }
00042         s.Connect("127.0.0.1");
00043         h.Add(&s);
00044         console.SetIcmpSocket(&s);
00045         h.Add(&console);
00046         h.Select(1,0);
00047         while (h.GetCount())
00048         {
00049                 h.Select(1,0);
00050         }
00051         return 0;
00052 }
00053 
00054 
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