Implemented selector support for asyncio2.
This commit is contained in:
parent
ed4f2f5e4d
commit
3b5825e9bc
7 changed files with 416 additions and 211 deletions
|
|
@ -17,11 +17,13 @@ when hostos == "solaris":
|
|||
|
||||
when defined(Windows):
|
||||
import winlean
|
||||
export ioctlsocket
|
||||
else:
|
||||
import posix
|
||||
export fcntl, F_GETFL, O_NONBLOCK, F_SETFL
|
||||
|
||||
export TSocketHandle, TSockaddr_in, TAddrinfo, INADDR_ANY, TSockAddr, TSockLen,
|
||||
inet_ntoa
|
||||
inet_ntoa, recv, `==`, connect, send, accept
|
||||
|
||||
type
|
||||
|
||||
|
|
@ -63,10 +65,10 @@ type
|
|||
|
||||
when defined(windows):
|
||||
let
|
||||
OSInvalidSocket* = winlean.INVALID_SOCKET
|
||||
osInvalidSocket* = winlean.INVALID_SOCKET
|
||||
else:
|
||||
let
|
||||
OSInvalidSocket* = posix.INVALID_SOCKET
|
||||
osInvalidSocket* = posix.INVALID_SOCKET
|
||||
|
||||
proc `==`*(a, b: TPort): bool {.borrow.}
|
||||
## ``==`` for ports.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue