]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - support/sdk/cpp/sf/tcpcomm.h
return from select when a client is added or removed
[tinyos-2.x.git] / support / sdk / cpp / sf / tcpcomm.h
index 624047b95e59a8951264e26e2c6eaaa2e834c8c3..35458587068dc25774975ac92c6de99890edeb08 100644 (file)
@@ -106,6 +106,10 @@ protected:
     /* file descriptor for server port on local machine */
     int serverFD;
 
+    /* pipe fd pair to inform client reader thread of new clients */
+    int pipeWriteFD;
+    int pipeReadFD;
+    
     /* reference to read packet buffer */
     PacketBuffer &readBuffer;    
 
@@ -163,6 +167,11 @@ protected:
     /* reports error to stderr */
     int reportError(const char *msg, int result);
 
+    /* write something into pipe to wake up client readerThread */
+    void stuffPipe();
+    
+    /* remove data written into pipe */
+    void clearPipe();
 
 public:
     /* create SF TCP server - init and start threads */