Many async optimisations.

* Selectors implementation will now attempt to immediately execute an IO
  operation instead of waiting for a ready notification.
* Removed recursion in asynchttpserver.
* Improved buffered implementation of recvLine in asyncnet.
* Optimised ``respond`` in asynchttpserver removing a possible "Delayed ACK"
  situation.
This commit is contained in:
Dominik Picheta 2014-07-12 22:51:06 +01:00
commit cf5c8a204e
4 changed files with 166 additions and 116 deletions

View file

@ -163,7 +163,7 @@ elif defined(linux):
proc newSelector*(): PSelector =
new result
result.epollFD = epoll_create(64)
result.events = cast[array[64, epoll_event]](alloc0(sizeof(epoll_event)*64))
#result.events = cast[array[64, epoll_event]](alloc0(sizeof(epoll_event)*64))
result.fds = initTable[TSocketHandle, PSelectorKey]()
if result.epollFD < 0:
OSError(OSLastError())