my application is something broadcast server, pseudo code like this:
while(shared_ptr<Message> m = read())
//this is important
Buffer buffer = CombineMessageToBuffer(messages_)
vector<shared_ptr<BufferedSocket>> sockets = epoll_wait()
for each socket in sockets:
I want gather write option, call system call "write" once to send everything(maybe twice). that is what i do in cpp.
how can i do this thing in rust?
or there is a better way?
thanks a lot.
We do not currently have an epoll/select abstraction. The current answer is "spawn a task per socket". Tracking select/epoll is done in #6842, so closing in favor of that issue.
Today, https://tokio.rs/ is what you'd use.