Esempio n. 1
0
 void TcpConnect::HandleConstAsyncWrite(const boost::shared_ptr<ByteBuffer> bytebuffer,
   int buffer_size, uint16 flag){
   if (state_ != CS_CONNECTED){
     //LOG(ERROR) << "The socket is not opened";
     return;
   }
   AppendWriteData(bytebuffer->Data(), buffer_size, flag);
 }
Esempio n. 2
0
  void TcpConnect::HandleAsyncWrite(boost::shared_ptr<ByteBuffer> bytebuffer,
    int buffer_size, uint16 flag){
    if (state_ != CS_CONNECTED){
      //LOG(ERROR) << "The socket is not opened";
      return;
    }

    AppendWriteData(bytebuffer->Data(), buffer_size, flag);
    boost::mutex::scoped_lock buffer_mutex(buffer_mutex_);
    bytebuffer->Consume(buffer_size);
  }