Subversion Repositories HomeAutomation

Rev

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

Rev 1595 Rev 1596
Line 108... Line 108...
108
    }
108
    }
109
   
109
   
110
    Client::Disconnect();
110
    Client::Disconnect();
111
}
111
}
112
 
112
 
113
void TcpClient::Send(Buffer data)
113
void TcpClient::Send(type::Byteset data)
114
{
114
{
115
    if (this->acceptor_.use_count() != 0)
115
    if (this->acceptor_.use_count() != 0)
116
    {
116
    {
117
        return;
117
        return;
118
    }
118
    }
119
   
119
   
120
    if (this->socket_.is_open())
120
    if (this->socket_.is_open())
121
    {
121
    {
122
        this->socket_.send(boost::asio::buffer(data));
122
        this->socket_.send(boost::asio::buffer(data.Get(), data.GetMaxSize()));
123
    }
123
    }
124
    else
124
    else
125
    {
125
    {
126
        this->Disconnect();
126
        this->Disconnect();
127
    }
127
    }
Line 129... Line 129...
129
 
129
 
130
void TcpClient::Read()
130
void TcpClient::Read()
131
{
131
{
132
    Client::Read();
132
    Client::Read();
133
   
133
   
134
    this->socket_.async_read_some(boost::asio::buffer(this->buffer_),
134
    this->socket_.async_read_some(boost::asio::buffer(this->buffer_.Get(), this->buffer_.GetMaxSize()),
135
                                  boost::bind(&TcpClient::ReadHandler,
135
                                  boost::bind(&TcpClient::ReadHandler,
136
                                              this,
136
                                              this,
137
                                              boost::asio::placeholders::error,
137
                                              boost::asio::placeholders::error,
138
                                              boost::asio::placeholders::bytes_transferred));
138
                                              boost::asio::placeholders::bytes_transferred));
139
}
139
}