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 69... Line 69...
69
    }
69
    }
70
   
70
   
71
    Client::Disconnect();
71
    Client::Disconnect();
72
}
72
}
73
 
73
 
74
void UdpClient::Send(Buffer data)
74
void UdpClient::Send(type::Byteset data)
75
{
75
{
76
    if (this->socket_->is_open())
76
    if (this->socket_->is_open())
77
    {
77
    {
78
        this->socket_->send_to(boost::asio::buffer(data), this->endpoint_);
78
        this->socket_->send_to(boost::asio::buffer(data.Get(), data.GetMaxSize()), this->endpoint_);
79
    }
79
    }
80
    else
80
    else
81
    {
81
    {
82
        this->Disconnect();
82
        this->Disconnect();
83
    }
83
    }
Line 85... Line 85...
85
 
85
 
86
void UdpClient::Read()
86
void UdpClient::Read()
87
{
87
{
88
    Client::Read();
88
    Client::Read();
89
   
89
   
90
    this->socket_->async_receive(boost::asio::buffer(this->buffer_),
90
    this->socket_->async_receive(boost::asio::buffer(this->buffer_.Get(), this->buffer_.GetMaxSize()),
91
                                 boost::bind(&UdpClient::ReadHandler,
91
                                 boost::bind(&UdpClient::ReadHandler,
92
                                             this,
92
                                             this,
93
                                             boost::asio::placeholders::error,
93
                                             boost::asio::placeholders::error,
94
                                             boost::asio::placeholders::bytes_transferred));
94
                                             boost::asio::placeholders::bytes_transferred));
95
}
95
}