aboutsummaryrefslogtreecommitdiff
path: root/lib/net/poll.go
AgeCommit message (Collapse)Author
2026-01-15all: convert license and copyright to use SPDX identifiersShulhan
With help of spdxconv tool [1], we able to bulk update all files license and copyright format to comply with SPDX formats. [1] https://kilabit.info/project/spdxconv/
2023-07-01lib/net: changes the WaitRead/Event model on PollShulhan
Previously, the Pool's WaitRead and WaitReadEVent methods return list of file descriptor (fd) and keeps the fd in the pool. In case we want to process the returned fd concurrently, by running it in different goroutine, the next call WaitRead may return the same fd if its goroutine not fast enought to read from fd. This changes fix this issue by removing list of fd from poll and set the fd flag to blocking mode again after returning it from WaitRead or WaitReadEvent. This changes also remove the ReregisterRead and ReregisterEvent methods since it is not applicable anymore.
2023-07-01lib/net: implement generic PollEventShulhan
The PollEvent contains file descriptor and the underlying event based on OS, unix.EpollEvent on Linux or unix.Kevent_t on BSD. The Poll interface provides two APIs to works with PollEvent, WaitReadEvents that return list of PollEvent ready for read, and ReregisterEvent to register the event back to poll (only for Linux).
2023-06-04lib/net: increase the maximum poll eventsShulhan
The maxQueue define the number of events that can be read from poll at one time. Using 128 seems to small for high throughput networks. Increasing this number also increase the memory consumed by process. Maybe later we can export this function as option when creating poll.
2022-05-09all: reformat all codes using gofmt 1.19 (the Go tip)Shulhan
2020-06-10all: update email addressShulhan
2019-11-04net: fix the implementation of epollShulhan
While at it, add copyright information.
2019-11-01net: implement network polling using epoll and kqueueShulhan
This is the first implementation of (almost) generic polling. The Poll currently only support the Read events from now, because the most common use case is for handling multiple socket without using goroutines.