Closed antonfirsov closed 4 years ago
@tmds does it look better now? any further suggestions?
@tmds I kept my handling logic sequential ("echo-serverish"). Based on your comments, it looks like you want to enable handling connections in parallel, right? Makes sense if we want to test various scheduling modes.
Based on your comments, it looks like you want to enable handling connections in parallel, right?
Yes. And we're in full control of how many epoll threads there are and how many clients connect. So we can still connect a single client and run that on a single epoll thread.
I kept my handling logic sequential ("echo-serverish").
I guess this is about my comment to refactor ClientConnectionHandler
? The suggested refactoring is sequential:
When a send is done, start a receive:
_sendArgs.Completed += (s, a) => ReceiveRequest();
When a request is complete, send a response:
if (RequestComplete(...))
{
_bytesReceived = 0;
SendResponse();
}
ManualResetEventSlim
will give some overhead, we don't need it.
@tmds just pushed your suggestions, works smoothly on my machine.
LGTM! Thanks!
Resolves #73.
Dumb as hell, can't handle concurrent connections.