Make some proper closes.
This commit is contained in:
parent
10fdd241ea
commit
fb4ff86ad6
2 changed files with 2 additions and 1 deletions
|
|
@ -316,6 +316,7 @@ proc write*(f: AsyncFile, data: string): Future[void] =
|
||||||
|
|
||||||
proc close*(f: AsyncFile) =
|
proc close*(f: AsyncFile) =
|
||||||
## Closes the file specified.
|
## Closes the file specified.
|
||||||
|
unregister(f.fd)
|
||||||
when defined(windows) or defined(nimdoc):
|
when defined(windows) or defined(nimdoc):
|
||||||
if not closeHandle(f.fd.Handle).bool:
|
if not closeHandle(f.fd.Handle).bool:
|
||||||
raiseOSError(osLastError())
|
raiseOSError(osLastError())
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ else:
|
||||||
await s.connect(testHost, testPort)
|
await s.connect(testHost, testPort)
|
||||||
|
|
||||||
var ps = await ls.accept()
|
var ps = await ls.accept()
|
||||||
SocketHandle(ls).close()
|
closeSocket(ls)
|
||||||
|
|
||||||
await ps.send("test 1", flags={})
|
await ps.send("test 1", flags={})
|
||||||
s.close()
|
s.close()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue