Subversion Repositories HomeAutomation

Rev

Rev 1971 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1971 Rev 1987
Line 79... Line 79...
79
 
79
 
80
void Client::Read()
80
void Client::Read()
81
{
81
{
82
  LOG_DEBUG_ENTER;
82
  LOG_DEBUG_ENTER;
83
 
83
 
-
 
84
  common::Byteset empty_vector(8192);
84
  this->buffer_.Clear();
85
  this->buffer_.swap(empty_vector);
85
 
86
 
86
  LOG_DEBUG_EXIT;
87
  LOG_DEBUG_EXIT;
87
}
88
}
88
 
89
 
89
void Client::ReadHandler(const boost::system::error_code& error, size_t size)
90
void Client::ReadHandler(const boost::system::error_code& error, size_t size)
Line 106... Line 107...
106
   
107
   
107
    this->Disconnect();
108
    this->Disconnect();
108
  }
109
  }
109
  else
110
  else
110
  {
111
  {
111
    this->buffer_.SetSize(size);
112
    log::Debug(log_module_, "size was %u", size);
112
   
113
   
113
    this->signal_on_new_data_(this->id_, this->server_id_, this->buffer_);
114
    this->signal_on_new_data_(this->id_, this->server_id_, common::Byteset(this->buffer_.begin(), this->buffer_.begin() + size));
114
   
115
   
115
    this->Read();
116
    this->Read();
116
  }
117
  }
117
 
118
 
118
  LOG_DEBUG_EXIT;
119
  LOG_DEBUG_EXIT;