Subversion Repositories HomeAutomation

Rev

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

Rev 1940 Rev 1959
Line 107... Line 107...
107
       
107
       
108
        net::Manager::Instance()->SendTo(this->client_id_, packet);
108
        net::Manager::Instance()->SendTo(this->client_id_, packet);
109
    }
109
    }
110
   
110
   
111
private:
111
private:
112
    net::ClientId client_id_;
112
    net::SocketId client_id_;
113
    std::string prompt_;
113
    std::string prompt_;
114
    std::vector<unsigned char> buffer_;
114
    std::vector<unsigned char> buffer_;
115
   
115
   
116
    void SlotOnNewStateHandler(net::ClientId client_id, net::ServerId server_id, net::ClientState client_state)
116
    void SlotOnNewStateHandler(net::SocketId client_id, net::SocketId server_id, net::ClientState client_state)
117
    {
117
    {
118
        if (client_state != net::CLIENT_STATE_CONNECTED)
118
        if (client_state != net::CLIENT_STATE_CONNECTED)
119
        {
119
        {
120
            std::cout << "Disconnected from server." << std::endl;
120
            std::cout << "Disconnected from server." << std::endl;
121
           
121
           
Line 123... Line 123...
123
            finish = true;
123
            finish = true;
124
            on_message_condition.notify_all();
124
            on_message_condition.notify_all();
125
        }
125
        }
126
    }
126
    }
127
   
127
   
128
    void SlotOnNewDataHandler(net::ClientId client_id, net::ServerId server_id, common::Byteset data)
128
    void SlotOnNewDataHandler(net::SocketId client_id, net::SocketId server_id, common::Byteset data)
129
    {
129
    {
130
        for (unsigned int n = 0; n < data.GetSize(); n++)
130
        for (unsigned int n = 0; n < data.GetSize(); n++)
131
        {
131
        {
132
            this->buffer_.push_back(data[n]);
132
            this->buffer_.push_back(data[n]);
133
        }
133
        }