Subversion Repositories HomeAutomation

Rev

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

Rev 1657 Rev 1664
Line 44... Line 44...
44
                                           net::Manager::SignalOnNewData::slot_type(&Console::SlotOnNewData, this, _1, _2, _3).track(this->tracker_));
44
                                           net::Manager::SignalOnNewData::slot_type(&Console::SlotOnNewData, this, _1, _2, _3).track(this->tracker_));
45
   
45
   
46
    this->ExportFunction("ConsoleExport_PromptRequest",        Console::Export_PromptRequest);
46
    this->ExportFunction("ConsoleExport_PromptRequest",        Console::Export_PromptRequest);
47
    this->ExportFunction("ConsoleExport_AutoCompleteResponse", Console::Export_AutoCompleteResponse);
47
    this->ExportFunction("ConsoleExport_AutoCompleteResponse", Console::Export_AutoCompleteResponse);
48
    this->ExportFunction("ConsoleExport_LogToClient",          Console::Export_LogToClient);
48
    this->ExportFunction("ConsoleExport_LogToClient",          Console::Export_LogToClient);
-
 
49
    this->ExportFunction("ConsoleExport_DisconnectClient",     Console::Export_DisconnectClient);
49
   
50
   
50
    try
51
    try
51
    {
52
    {
52
        this->server_id_ = net::Manager::Instance()->StartServer(net::PROTOCOL_TCP, port);
53
        this->server_id_ = net::Manager::Instance()->StartServer(net::PROTOCOL_TCP, port);
53
        LOG.Info("Started TCP server on port " + boost::lexical_cast<std::string>(port) + ".");
54
        LOG.Info("Started TCP server on port " + boost::lexical_cast<std::string>(port) + ".");
Line 245... Line 246...
245
    std::string packet = "TEXT";
246
    std::string packet = "TEXT";
246
    packet += common::PadNumber(line.length() + 1, 4);
247
    packet += common::PadNumber(line.length() + 1, 4);
247
    packet += line;
248
    packet += line;
248
   
249
   
249
    net::Manager::Instance()->SendTo(args[0]->Uint32Value(), packet);
250
    net::Manager::Instance()->SendTo(args[0]->Uint32Value(), packet);
-
 
251
    return v8::Boolean::New(true);
-
 
252
}
-
 
253
 
-
 
254
Value Console::Export_DisconnectClient(const v8::Arguments& args)
-
 
255
{
-
 
256
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
-
 
257
   
-
 
258
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
-
 
259
   
-
 
260
    if (args.Length() < 1)
-
 
261
    {
-
 
262
        LOG.Error(std::string(__FUNCTION__) + ": To few arguments.");
-
 
263
        return v8::Boolean::New(false);
-
 
264
    }
-
 
265
    net::Manager::Instance()->Disconnect(args[0]->Uint32Value());
250
    return v8::Boolean::New(true);
266
    return v8::Boolean::New(true);
251
}
267
}
252
 
268
 
253
}; // namespace plugin
269
}; // namespace plugin
254
}; // namespace vm
270
}; // namespace vm