Lines Matching refs:fd
206 var fd;
236 for (fd in this.socketListening) {
237 poll_set[fd] = { events: POLLIN, revents: 0 };
240 for (fd in this.socketReading) {
241 poll_set[fd] = { events: POLLIN, revents: 0 };
244 for (fd in this.socketConnecting) {
245 poll_set[fd] = { events: POLLOUT, revents: 0 };
284 for (fd in poll_set) {
285 t = poll_set[fd];
289 cb = this.socketReading[fd];
291 data = Socket.read(fd); // no size control now
295 rc = Socket.close(fd); // ignore result
296 delete this.socketListening[fd];
297 delete this.socketReading[fd];
299 cb(fd, data);
302 cb = this.socketListening[fd];
304 acc_res = Socket.accept(fd);
306 cb(acc_res.fd, acc_res.addr, acc_res.port);
314 cb = this.socketConnecting[fd];
316 delete this.socketConnecting[fd];
317 cb(fd);
325 rc = Socket.close(fd); // ignore result
326 delete this.socketListening[fd];
327 delete this.socketReading[fd];
338 var fd = Socket.createServerSocket(address, port);
339 this.socketListening[fd] = cb_accepted;
343 var fd = Socket.connect(address, port);
344 this.socketConnecting[fd] = cb_connected;
347 EventLoop.close = function(fd) { argument
348 delete this.socketReading[fd];
349 delete this.socketListening[fd];
352 EventLoop.setReader = function(fd, cb_read) { argument
353 this.socketReading[fd] = cb_read;
356 EventLoop.write = function(fd, data) { argument
358 var rc = Socket.write(fd, Duktape.Buffer(data));