parent
ea4160b23f
commit
54219245e7
1 changed files with 3 additions and 3 deletions
|
|
@ -399,13 +399,13 @@ proc bindAddr*(socket: AsyncSocket, port = Port(0), address = "") {.
|
||||||
|
|
||||||
proc close*(socket: AsyncSocket) =
|
proc close*(socket: AsyncSocket) =
|
||||||
## Closes the socket.
|
## Closes the socket.
|
||||||
socket.fd.TAsyncFD.closeSocket()
|
defer:
|
||||||
|
socket.fd.TAsyncFD.closeSocket()
|
||||||
when defined(ssl):
|
when defined(ssl):
|
||||||
if socket.isSSL:
|
if socket.isSSL:
|
||||||
let res = SslShutdown(socket.sslHandle)
|
let res = SslShutdown(socket.sslHandle)
|
||||||
if res == 0:
|
if res == 0:
|
||||||
if SslShutdown(socket.sslHandle) != 1:
|
discard
|
||||||
raiseSslError()
|
|
||||||
elif res != 1:
|
elif res != 1:
|
||||||
raiseSslError()
|
raiseSslError()
|
||||||
socket.closed = true # TODO: Add extra debugging checks for this.
|
socket.closed = true # TODO: Add extra debugging checks for this.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue