/[H7]/branches/linux-serial/server/serverthread.cpp
ViewVC logotype

Diff of /branches/linux-serial/server/serverthread.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 69 by torben, Wed Feb 7 00:24:04 2007 UTC revision 70 by torben, Wed Feb 7 08:03:48 2007 UTC
# Line 28  ServerThread::~ServerThread() Line 28  ServerThread::~ServerThread()
28          }          }
29  }  }
30    
31  void ServerThread::parsePackage(std::string str)  void ServerThread::parsePackage(std::string str, TCPConnection& conn)
32  {  {
33            std::cout << "parsePackage: " << str << std::endl;
34    
35            GlobalStorage* store = GlobalStorage::instance();
36          if ( str == "100")          if ( str == "100")
37          {          {
38                  std::ostringstream tmp;                  std::ostringstream tmp;
# Line 118  void ServerThread::operator()() Line 121  void ServerThread::operator()()
121                          if (str.size() >0)                          if (str.size() >0)
122                          {                          {
123                                  cout << "Got " << str.size() << " bytes :" << str << endl;                                  cout << "Got " << str.size() << " bytes :" << str << endl;
124                                  do                                  while (str.size() >= 3)
125                                  {                                  {
126                                  } while (str.length                                          std::string package = str.substr(0,3);
127                                            parsePackage(package, conn);
128    
129                                            str = str.substr(3, str.size()-3);
130                                            
131                                    }
132                          }                          }
133                          str = "";                          str = "";
134                  }                  }

Legend:
Removed from v.69  
changed lines
  Added in v.70

  ViewVC Help
Powered by ViewVC 1.1.20