Lines Matching refs:fd
24 // as well as providing a per-fd-registered summary of
68 // fd - the file descriptor which was registered
72 virtual void OnRegistration(EpollServer* eps, int fd, int event_mask) = 0;
77 // fd - the file descriptor which was registered
81 virtual void OnModification(int fd, int event_mask) = 0;
87 // fd - the file descriptor which was registered
92 // this fd on the ready list.
93 virtual void OnEvent(int fd, EpollEvent* event) = 0;
98 // fd - the file descriptor which was registered, and of this call, is now
102 virtual void OnUnregistration(int fd, bool replaced) = 0;
109 // fd - the file descriptor which was registered.
110 virtual void OnShutdown(EpollServer* eps, int fd) = 0;
146 // file-descriptor 'fd'
155 // OnUnregistration(fd, true);
161 // fd - a valid file-descriptor
166 virtual void RegisterFD(int fd, CB* cb, int event_mask);
172 // callback is called when 'fd' is available for writing.
174 // fd - a valid file-descriptor
176 virtual void RegisterFDForWrite(int fd, CB* cb);
182 // callback is called when 'fd' is available for reading or writing.
184 // fd - a valid file-descriptor
186 virtual void RegisterFDForReadWrite(int fd, CB* cb);
192 // callback is called when 'fd' is available for reading.
194 // fd - a valid file-descriptor
196 virtual void RegisterFDForRead(int fd, CB* cb);
207 // fd - the file-descriptor which should no-longer be monitored.
208 virtual void UnregisterFD(int fd);
218 // fd - the fd whose event mask should be modified.
220 virtual void ModifyCallback(int fd, int event_mask);
226 // no longer request events when 'fd' is readable.
230 // fd - the fd whose event mask should be modified.
231 virtual void StopRead(int fd);
237 // request events when 'fd' is readable.
241 // fd - the fd whose event mask should be modified.
242 virtual void StartRead(int fd);
248 // no longer request events when 'fd' is writable.
252 // fd - the fd whose event mask should be modified.
253 virtual void StopWrite(int fd);
259 // request events when 'fd' is writable.
263 // fd - the fd whose event mask should be modified.
264 virtual void StartWrite(int fd);
269 // Looks up the callback associated with the file-desriptor 'fd'.
271 // it's OnEvent() method is called with the file-descriptor 'fd',
279 // this function with an fd and event_mask is equivalent (as far
284 // fd - the file-descriptor on which an event has occured.
286 // on/for this fd. This bitmask is composed of
289 void HandleEvent(int fd, int event_mask);
301 // When an fd is registered to use edge trigger notification, the ready
308 // epoll_wait(). The fd is removed from the ready list before the
311 // again. When a fd is unregistered using UnregisterFD(), the fd is
314 // When the callback for a edge triggered fd hits the falling edge (about
324 // doesn't know about the fd passed in.
331 // the fd with the kernel. If a fd is already put on the ready list, and
332 // SetFDReady() is called again for that fd with a different event_mask,
334 virtual void SetFDReady(int fd, int events_to_fake);
336 virtual void SetFDNotReady(int fd);
341 // ISFDReady() returns whether a fd is in the ready list.
345 virtual bool IsFDReady(int fd) const;
485 // of the fd in the ready list, and takes care of adding them back to the
495 virtual int GetFlags(int fd);
496 inline int SetFlags(int fd, int flags) {
497 return fcntl(fd, F_SETFL, flags | O_NONBLOCK);
500 virtual void SetNonblocking(int fd);
515 // fd. Everything else are just along for the ride and changing them doesn't
520 fd(-1),
531 int fd)
532 : cb(cb), fd(fd), event_mask(event_mask), events_asserted(0),
542 return fd == cb_and_mask.fd;
544 // A callback. If the fd is unregistered inside the callchain of OnEvent,
550 int fd;
565 return static_cast<size_t>(cb_and_eventmask.fd);
582 // fd - the file descriptor to-be-removed from the monitoring set
583 virtual void DelFD(int fd) const;
593 // fd - the file descriptor to-be-added to the monitoring set
597 virtual void AddFD(int fd, int event_mask) const;
607 // fd - the file descriptor to-be-added to the monitoring set
611 virtual void ModFD(int fd, int event_mask) const;
624 // fd - the file descriptor whose event mask is to be modified
630 virtual void ModifyFD(int fd, int remove_event, int add_event);
636 // fd, event pair discovered to possibly have an event.
648 // An internal function for implementing the ready list. It adds a fd's
649 // CBAndEventMask to the ready list. If the fd is already on the ready
654 // An internal function for implementing the ready list. It remove a fd's
655 // CBAndEventMask from the ready list. If the fd is not on the ready list,
764 void RecordFDMaskEvent(int fd, int mask, const char* function) {
765 FDMaskOutput* fdmo = new FDMaskOutput(fd, mask, function);
778 void RecordEpollEvent(int fd, int event_mask) {
779 Events& events_for_fd = event_counts_[fd];
786 os << "fd: " << er.unregistered_fds_[i] << "\n";
792 os << "fd: " << i->first << "\n";
801 void RecordUnregistration(int fd) {
802 EventCountsMap::iterator i = event_counts_.find(fd);
823 FDMaskOutput(int fd, int mask, const char* function) :
824 fd_(fd), mask_(mask), function_(function) {}