1. divius
  2. libpycom

Commits

divius  committed 2a5605a

Support for PyCOM v0.3 sessions

  • Participants
  • Parent commits 8a5d476
  • Branches default
  • Tags 0.1.1

Comments (0)

Files changed (2)

File libpycom/component.cc

View file
     temp["interface"] = _pvt->iface_name;
     temp["method"] = method_name;
     temp["args"] = args;
+    temp["session_id"] = _pvt->session_id;
 
     std::string json = _pvt->writer.write(temp);
 
         throw InternalError(error);
     }
 
+    if (!temp["session_id"].isNull()) {
+        _pvt->session_id = temp["session_id"];
+    }
+
     switch (temp["code"].asInt()) {
         case SUCCESS:
             return temp["result"];

File libpycom/pycom-private.h

View file
     std::string iface_name;
     Reader reader;
     FastWriter writer;
+    Value session_id;
 
     _component_pvt(_context_pvt *new_ctx, const std::string &new_iface_name)
         : ctx(new_ctx), zsock(ctx->zcontext, ZMQ_REQ), iface_name(new_iface_name)