INCLUDEDIR = /usr/include
-CFLAGS = -O3 -Wall
+CFLAGS = -DDEBUG -O3 -Wall
OBJS = stream receive datagram dgramrcv
}
optlen=1;
- setsockopt(send_fd,SOL_SOCKET,SO_BROADCAST,NULL,optlen);
+ if((setsockopt(send_fd,SOL_SOCKET,SO_BROADCAST,NULL,optlen))==-1)
+ perror("setsockopt");
+
memset(&local_addr,0,sizeof(local_addr));
local_addr.sin_family=AF_INET;
unsigned char buf[1000];
read_bytes=read(0,buf,sizeof(buf));
send_bytes=sendto(send_fd,buf,read_bytes,0,(struct sockaddr *)&remote_addr,remote_addr_len);
+#ifdef DEBUG
+ perror("sendto");
+#endif
+
fwrite(buf,read_bytes,1,cmd_fd);
}