We can do something like this, in felix pseudocode:

proc lingering_close(s: socket) {
   var open = true;

   proc close {
      if(open) then {
          socket_close(s);
         open = false;
      } else {};
   };


  // timeout
  spawn_fthread {
      sleep(2);
      close;
      exit;  // exit fthread
   };

  do{
      // read data from s
   } while{ open and not eof) } ;
   close;
};

simple boolean open flag suffices because the fthreads
are run synchronously.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to