void tellService() { #ifndef USINGINTERNAL system("sdmsg Banner"); #else SocketTCP tcp; if (tcp.Open(WIJET2_PORT, htonl(INADDR_LOOPBACK)) != 0) { if(tcp.Send("Banner", 6) < 1) fprintf(stderr, "Send fails\n"); tcp.Close(); } else fprintf(stderr, "error to open socket???\n"); #endif }
int getIP() { SocketTCP myTCP; char buf[40]; unsigned int n = 0; myTCP.Open(WIJET2_PORT, htonl(INADDR_LOOPBACK)); strcpy(buf, "AskIP"); if (myTCP.Send(buf, strlen(buf) +1) > 0) { if (myTCP.Recv(buf, 40) > 0) { sscanf(buf, "%u", &n); } } return n; }