X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..fe04f8e5b966ee95f15d7745c0f1cccbae779289:/projects/stargazer/plugins/other/rscript/send_functor.h diff --git a/projects/stargazer/plugins/other/rscript/send_functor.h b/projects/stargazer/plugins/other/rscript/send_functor.h index 479cdc3b..8e216295 100644 --- a/projects/stargazer/plugins/other/rscript/send_functor.h +++ b/projects/stargazer/plugins/other/rscript/send_functor.h @@ -34,23 +34,22 @@ #include "os_int.h" -class PacketSender : public std::unary_function { +class PacketSender : public std::unary_function { public: PacketSender(int s, char * b, int l, uint16_t p) : sock(s), buffer(b), length(l), port(p) {}; - void operator() (uint32_t ip) + int operator() (uint32_t ip) { - int res; struct sockaddr_in sendAddr; sendAddr.sin_family = AF_INET; sendAddr.sin_port = port; sendAddr.sin_addr.s_addr = ip; - res = sendto(sock, buffer, length, 0, (struct sockaddr*)&sendAddr, sizeof(sendAddr)); + return sendto(sock, buffer, length, 0, (struct sockaddr*)&sendAddr, sizeof(sendAddr)); } private: int sock;