Example unix socket echo server
coolaj86 at gmail.com
Sat Oct 30 00:25:50 CEST 2010
I spent a few hours reading through the documentation. I didn't understand
all of it, but it was enlightening.
I've done a fair amount of googling and I've found some reference
implementations using libev.
However, I'm now trying to build my own bare-bones socket-based echo server
and I'm not quite sure how to go about it, nor have I found anything n the
middle between between the too simple stdin example and the over-my-head
Am I correct that this is what the flow will be like?
- Server waits for data in non-blocking fashion
- Event fires when a client connects
- Server receives data in non-blocking fashion
- Server chews bubble gum or something for a while, maybe accepts another
- Event fires when data is received
- Server echos data
Here's the code that I have so far:
What I don't understand right now is why the socket is ready for reading
when nothing is connecting to it to read from.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the libev