Subversion Repositories HomeAutomation

Rev

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

Rev 1651 Rev 1740
Line 75... Line 75...
75
    this->io_service_.post(boost::bind(&Socket::SlotOnNewStateHandler, this, client_id, server_id, client_state));
75
    this->io_service_.post(boost::bind(&Socket::SlotOnNewStateHandler, this, client_id, server_id, client_state));
76
}
76
}
77
 
77
 
78
void Socket::SlotOnNewDataHandler(net::ClientId client_id, net::ServerId server_id, common::Byteset data)
78
void Socket::SlotOnNewDataHandler(net::ClientId client_id, net::ServerId server_id, common::Byteset data)
79
{
79
{
-
 
80
    v8::Locker lock;
80
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
81
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
81
   
82
   
82
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
83
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
83
     
84
     
84
    ArgumentListPointer arguments = ArgumentListPointer(new ArgumentList);
85
    ArgumentListPointer arguments = ArgumentListPointer(new ArgumentList);
Line 88... Line 89...
88
    this->Call( client_id, "Socket_OnNewData", arguments);
89
    this->Call( client_id, "Socket_OnNewData", arguments);
89
}
90
}
90
 
91
 
91
void Socket::SlotOnNewStateHandler(net::ClientId client_id, net::ServerId server_id, net::ClientState client_state)
92
void Socket::SlotOnNewStateHandler(net::ClientId client_id, net::ServerId server_id, net::ClientState client_state)
92
{
93
{
-
 
94
    v8::Locker lock;
93
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
95
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
94
   
96
   
95
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
97
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
96
   
98
   
97
    ArgumentListPointer arguments = ArgumentListPointer(new ArgumentList);
99
    ArgumentListPointer arguments = ArgumentListPointer(new ArgumentList);
Line 101... Line 103...
101
    this->Call( client_id, "Socket_OnNewState", arguments);
103
    this->Call( client_id, "Socket_OnNewState", arguments);
102
}
104
}
103
 
105
 
104
Value Socket::Export_Connect(const v8::Arguments& args)
106
Value Socket::Export_Connect(const v8::Arguments& args)
105
{
107
{
-
 
108
    v8::Locker lock;
106
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
109
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
107
   
110
   
108
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
111
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
109
   
112
   
110
    if (args.Length() < 2)
113
    if (args.Length() < 2)
Line 120... Line 123...
120
    return v8::Integer::New(client_id);
123
    return v8::Integer::New(client_id);
121
}
124
}
122
 
125
 
123
Value Socket::Export_Disconnect(const v8::Arguments& args)
126
Value Socket::Export_Disconnect(const v8::Arguments& args)
124
{
127
{
-
 
128
    v8::Locker lock;
125
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
129
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
126
   
130
   
127
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
131
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
128
   
132
   
129
    if (args.Length() < 1)
133
    if (args.Length() < 1)
Line 137... Line 141...
137
    return v8::Undefined();
141
    return v8::Undefined();
138
}
142
}
139
 
143
 
140
Value Socket::Export_Send(const v8::Arguments& args)
144
Value Socket::Export_Send(const v8::Arguments& args)
141
{
145
{
-
 
146
    v8::Locker lock;
142
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
147
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
143
   
148
   
144
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
149
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
145
   
150
   
146
    if (args.Length() < 2)
151
    if (args.Length() < 2)