]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/rscript/send_functor.h
Handle callback errors in bfstreams.
[stg.git] / projects / stargazer / plugins / other / rscript / send_functor.h
index b9b789eaf1556ed034ae350b29b6479d96714b63..a14fe20b3e95cdf18ec602fc656d087974ab0654 100644 (file)
 
 #include "stg/os_int.h"
 
 
 #include "stg/os_int.h"
 
-class PacketSender : public std::unary_function<uint32_t, int> {
+class PacketSender : public std::unary_function<uint32_t, ssize_t> {
     public:
     public:
-        PacketSender(int s, char * b, int l, uint16_t p)
+        PacketSender(int s, char * b, size_t l, uint16_t p)
             : sock(s),
               buffer(b),
               length(l),
             : sock(s),
               buffer(b),
               length(l),
-              port(p) {};
-        int operator() (uint32_t ip)
+              port(p) {}
+        ssize_t operator() (uint32_t ip)
         {
         struct sockaddr_in sendAddr;
 
         {
         struct sockaddr_in sendAddr;
 
@@ -54,7 +54,7 @@ class PacketSender : public std::unary_function<uint32_t, int> {
     private:
         int sock;
         char * buffer;
     private:
         int sock;
         char * buffer;
-        int length;
+        size_t length;
         uint16_t port;
 };
 
         uint16_t port;
 };