does that mean that Stdio.File()->close() does not free the filedescriptor?
At least the asynchronous callback does not (as in, when it's called you have to wait for a gc() to get rid of the file, even if you thow away the object, close() only causes an error).
I have not actually tried close, though. But this:
for(int i=0; i<10000; i++) Stdio.File(".")->close();
indicates that it is actually closed (since my FD-max is 65k, not 100k fd:s).
However:
start backend for(int i=0; i<300; i++) {object q=Stdio.File();q->connect("127.0.0.1", 8080);q->write("GET / HTTP/1.0\r\n\r\n");q->set_nonblocking(lambda(){werror("data");},lambda(){},lambda(){werror("closed\n");});}
Ok. <insert data and closed * 100 here>
sizeof(Stdio.get_all_active_fd());
(5) Result: 311
gc();
(6) Result: 607
sizeof(Stdio.get_all_active_fd());
(7) Result: 11