Logo
~Sockets~
~Examples~
~Contact~


ClientSocket.cpp

Go to the documentation of this file.
00001 //#include <stdio.h>
00002 
00003 #include "ClientSocket.h"
00004 
00005 
00006 
00007 
00008 ClientSocket::ClientSocket(ISocketHandler& h,const std::string& cmd)
00009 :TcpSocket(h)
00010 ,m_cmd(cmd)
00011 {
00012         SetLineProtocol();
00013 }
00014 
00015 
00016 ClientSocket::~ClientSocket()
00017 {
00018 }
00019 
00020 
00021 void ClientSocket::OnConnect()
00022 {
00023         Send(m_cmd + "\n");
00024 }
00025 
00026 
00027 void ClientSocket::OnLine(const std::string& line)
00028 {
00029         printf("Reply from server: '%s'\n",line.c_str());
00030         if (line.size())
00031         {
00032         }
00033         else
00034         {
00035                 SetCloseAndDelete();
00036         }
00037 }
00038 
00039 
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