Skip to content

Commit

Permalink
Merge pull request #4303 from cheatfate/properClose
Browse files Browse the repository at this point in the history
Make some proper closes.
  • Loading branch information
dom96 committed Jun 9, 2016
2 parents 10fdd24 + fb4ff86 commit 0ea65a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/pure/asyncfile.nim
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ proc write*(f: AsyncFile, data: string): Future[void] =

proc close*(f: AsyncFile) =
## Closes the file specified.
unregister(f.fd)
when defined(windows) or defined(nimdoc):
if not closeHandle(f.fd.Handle).bool:
raiseOSError(osLastError())
Expand Down
2 changes: 1 addition & 1 deletion tests/async/tasynceverror.nim
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ else:
await s.connect(testHost, testPort)

var ps = await ls.accept()
SocketHandle(ls).close()
closeSocket(ls)

await ps.send("test 1", flags={})
s.close()
Expand Down

0 comments on commit 0ea65a8

Please sign in to comment.