void jswrap_net_server_listen(JsVar *parent, int port) { JsNetwork net; if (!networkGetFromVarIfOnline(&net)) return; serverListen(&net, parent, port); networkFree(&net); }
void MainScreen::onIpPostButtonClickMessage(IpPostView* pSender, string ip, short post) { if (pSender->getTag() == ID_LISTEN_VIEW) { if (m_pNetworkServer == NULL) { serverListen(ip.c_str(), post); } else { serverClose(); } } else if (pSender->getTag() == ID_CONNECT_VIEW) { if (NetworkClient::sharedDelegate()->isConnected()) { clientClose(); } else { clientConnect(ip.c_str(), post); } } }
int main (int argc, char **argv) { init(); if (fork() !=0 ) return 0; (void) signal(SIGCLD, SIG_IGN); (void) signal(SIGHUP, SIG_IGN); scrub(); logText("Starting"); serverListen(8082); fail("testing failure"); }