![]() |
ClientSocket.cppGo 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 |