Subversion Repositories HomeAutomation

Rev

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

Rev 1664 Rev 1740
Line 104... Line 104...
104
    this->io_service_.post(boost::bind(&Console::SlotOnNewStateHandler, this, client_id, server_id, client_state));
104
    this->io_service_.post(boost::bind(&Console::SlotOnNewStateHandler, this, client_id, server_id, client_state));
105
}
105
}
106
 
106
 
107
void Console::SlotOnNewDataHandler(net::ClientId client_id, net::ServerId server_id, common::Byteset data)
107
void Console::SlotOnNewDataHandler(net::ClientId client_id, net::ServerId server_id, common::Byteset data)
108
{
108
{
-
 
109
    v8::Locker lock;
109
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
110
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
110
 
111
 
111
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
112
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
112
 
113
 
113
    std::string s(data.ToCharString());
114
    std::string s(data.ToCharString());
Line 150... Line 151...
150
    Console::current_client_id_ = 0;
151
    Console::current_client_id_ = 0;
151
}
152
}
152
 
153
 
153
void Console::SlotOnNewStateHandler(net::ClientId client_id, net::ServerId server_id, net::ClientState client_state)
154
void Console::SlotOnNewStateHandler(net::ClientId client_id, net::ServerId server_id, net::ClientState client_state)
154
{
155
{
-
 
156
    v8::Locker lock;
155
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
157
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
156
 
158
 
157
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
159
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
158
   
160
   
159
    if (client_state == net::CLIENT_STATE_DISCONNECTED)
161
    if (client_state == net::CLIENT_STATE_DISCONNECTED)
Line 183... Line 185...
183
    }
185
    }
184
}
186
}
185
 
187
 
186
Value Console::Export_PromptRequest(const v8::Arguments& args)
188
Value Console::Export_PromptRequest(const v8::Arguments& args)
187
{
189
{
-
 
190
    v8::Locker lock;
188
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
191
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
189
   
192
   
190
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
193
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
191
   
194
   
192
    if (args.Length() < 2)
195
    if (args.Length() < 2)
Line 205... Line 208...
205
    return v8::Boolean::New(true);
208
    return v8::Boolean::New(true);
206
}
209
}
207
 
210
 
208
Value Console::Export_AutoCompleteResponse(const v8::Arguments& args)
211
Value Console::Export_AutoCompleteResponse(const v8::Arguments& args)
209
{
212
{
-
 
213
    v8::Locker lock;
210
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
214
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
211
   
215
   
212
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
216
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
213
   
217
   
214
    if (args.Length() < 2)
218
    if (args.Length() < 2)
Line 227... Line 231...
227
    return v8::Boolean::New(true);
231
    return v8::Boolean::New(true);
228
}
232
}
229
 
233
 
230
Value Console::Export_LogToClient(const v8::Arguments& args)
234
Value Console::Export_LogToClient(const v8::Arguments& args)
231
{
235
{
-
 
236
    v8::Locker lock;
232
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
237
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
233
   
238
   
234
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
239
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
235
   
240
   
236
    if (args.Length() < 2)
241
    if (args.Length() < 2)
Line 251... Line 256...
251
    return v8::Boolean::New(true);
256
    return v8::Boolean::New(true);
252
}
257
}
253
 
258
 
254
Value Console::Export_DisconnectClient(const v8::Arguments& args)
259
Value Console::Export_DisconnectClient(const v8::Arguments& args)
255
{
260
{
-
 
261
    v8::Locker lock;
256
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
262
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
257
   
263
   
258
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
264
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
259
   
265
   
260
    if (args.Length() < 1)
266
    if (args.Length() < 1)