SocketService.cpp
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:2k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. /* Copyright (C) 2003 MySQL AB
  2.    This program is free software; you can redistribute it and/or modify
  3.    it under the terms of the GNU General Public License as published by
  4.    the Free Software Foundation; either version 2 of the License, or
  5.    (at your option) any later version.
  6.    This program is distributed in the hope that it will be useful,
  7.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  8.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  9.    GNU General Public License for more details.
  10.    You should have received a copy of the GNU General Public License
  11.    along with this program; if not, write to the Free Software
  12.    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
  13. #include <Parser.hpp>
  14. #include <NdbOut.hpp>
  15. #include <Properties.hpp>
  16. #include "SocketService.hpp"
  17. SocketService::SocketService() {
  18. }
  19. SocketService::~SocketService() {
  20. }
  21. int
  22. SocketService::runSession(NDB_SOCKET_TYPE socket, SocketService & ss){
  23.   InputStream *m_input = new SocketInputStream(socket);
  24.   char buf[255];
  25.   m_input->gets(buf,255);
  26.   ndbout_c("SocketService:received: %sn", buf);
  27.   ndbout_c("This should now be parsedn");
  28.   ndbout_c("and put in a property object.n");
  29.   ndbout_c("The propery is then accessible from the ClientInterface.n");
  30.   ndbout_c("by getPropertyObject.n");
  31.   ndbout_c("At least this is the idea.");
  32.     /*Parser_t *m_parser = 
  33.       new Parser<SocketService>(commands, *m_input, true, true, true);
  34.       */
  35.   /** to do
  36.    * add a proprty object to which the parser will put its result.
  37.    */
  38.   
  39.   return 1 ; //succesful
  40.   //return 0; //unsuccesful
  41. }
  42. void
  43. SocketService::getPropertyObject() {
  44.   ndbout << "get property object. return to front end or something" << endl;
  45. }