Exemplo n.º 1
0
void onelab_listen_udt_cb(Fl_Widget *w, void *data)
{
  Fl_Check_Button *checkbutton = (Fl_Check_Button *)w;
  Fl_Input *sockUDT = (Fl_Input *)data;
  if(checkbutton->value() == 1) {
    sockUDT->deactivate();
    CTX::instance()->onelab.udtSock = sockUDT->value();
    std::size_t colon = CTX::instance()->onelab.udtSock.find(":");
    OnelabServer::instance()->listenOnTcp(
      ip4_inet_pton(CTX::instance()->onelab.udtSock.substr(0, colon).c_str()),
      atoi(CTX::instance()->onelab.udtSock.substr(colon+1, CTX::instance()->onelab.udtSock.size()-colon-1).c_str()));
  }
  else {
    sockUDT->activate();
    OnelabServer::instance()->stopUdt();
  }
}
Exemplo n.º 2
0
void onelab_listen_unix_cb(Fl_Widget *w, void *data)
{
  Fl_Check_Button *checkbutton = (Fl_Check_Button *)w;
  Fl_Input *sockUNIX = (Fl_Input *)data;
  if(checkbutton->value() == 1) {
    sockUNIX->deactivate();
    CTX::instance()->onelab.unixSock = sockUNIX->value();
    std::size_t colon = CTX::instance()->onelab.unixSock.find(":");
    std::ostringstream tmp;
    tmp << CTX::instance()->homeDir << CTX::instance()->onelab.unixSock;
    OnelabServer::instance()->listenOnUnix(tmp.str().c_str());
  }
  else {
    sockUNIX->activate();
    OnelabServer::instance()->stopUnix();
  }
}
				void ActivateWidgets() {
					bInput->activate();
					connectbtn->activate();
					connectbtn->label("Connect");
				}