Permalink
Browse files

core, bugfix: closesocket before canceling io operation.

  • Loading branch information...
xicilion committed Nov 2, 2017
1 parent 98e4d2e commit 00440c163266174fc123ac74fbfbe2c27e3e4929
Showing with 3 additions and 4 deletions.
  1. +3 −4 fibjs/src/io/AsyncIO_ev.cpp
@@ -284,17 +284,16 @@ result_t AsyncIO::close(intptr_t& s, AsyncEvent* ac)
virtual void start()
{
if (m_s != INVALID_SOCKET) {
::closesocket(m_s);
m_s = INVALID_SOCKET;
if (m_opt1)
((asyncProc*)m_opt1)->onready();
if (m_opt2)
((asyncProc*)m_opt2)->onready();
::closesocket(m_s);
}
m_s = INVALID_SOCKET;
m_ac->apost(0);
delete this;
}

0 comments on commit 00440c1

Please sign in to comment.