This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong.
xxxxxxxxxx
====== SDK Script udpserver.are ======
<code c udpserver.are>
/* DESC: This script implements an UDP server which is able to receive messages.
* Copyright (C) 2012-2016 NetModule AG, Switzerland
*/
void usage()
{
printf("usage: udpserver.are <port>\n");
exit(1);
}
if (argc < 2) {
usage();
PORT = (int) argv[1];
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (sock < 0) {
nb_syslog("Unable to open socket");
/* bind socket to 1st LAN interface */
addr = nb_ifc_address("LAN1");
ret = bind(sock, PORT, addr);
if(ret == -1) {