Permalink
Browse files

net, refactor: remove no use argument in function AsyncIO::close.

  • Loading branch information...
xicilion committed Nov 11, 2017
1 parent 2dbe78c commit e71a1bf382efefe6d768ba02ee91338f9c25bfc7
Showing with 10 additions and 10 deletions.
  1. +6 −6 fibjs/include/AsyncIO.h
  2. +1 −1 fibjs/include/SubProcess.h
  3. +2 −2 fibjs/src/io/AsyncIO_ev.cpp
  4. +1 −1 fibjs/src/net/Socket.cpp
View
@@ -52,18 +52,18 @@ class AsyncIO {
result_t recvfrom(int32_t bytes, obj_ptr<NObject>& retVal, AsyncEvent* ac);
#ifndef _WIN32
result_t close(intptr_t& s, AsyncEvent* ac);
result_t close(AsyncEvent* ac);
#else
result_t close(intptr_t& s, AsyncEvent* ac)
result_t close(AsyncEvent* ac)
{
if (s != INVALID_SOCKET) {
if (m_fd != INVALID_SOCKET) {
if (m_type == -1)
::CloseHandle((HANDLE)s);
::CloseHandle((HANDLE)m_fd);
else
::closesocket(s);
::closesocket(m_fd);
}
s = INVALID_SOCKET;
m_fd = INVALID_SOCKET;
return 0;
}
@@ -112,7 +112,7 @@ class SubProcess : public SubProcess_base {
if (ac->isSync())
return CHECK_ERROR(CALL_E_NOSYNC);
return m_aio.close(m_aio.m_fd, ac);
return m_aio.close(ac);
}
virtual result_t copyTo(Stream_base* stm, int64_t bytes,
@@ -236,7 +236,7 @@ void init_aio()
s_acIO.start();
}
result_t AsyncIO::close(intptr_t& s, AsyncEvent* ac)
result_t AsyncIO::close(AsyncEvent* ac)
{
class asyncClose : public asyncEv {
public:
@@ -272,7 +272,7 @@ result_t AsyncIO::close(intptr_t& s, AsyncEvent* ac)
void*& m_opt2;
};
(new asyncClose(s, m_RecvOpt, m_SendOpt, ac))->post();
(new asyncClose(m_fd, m_RecvOpt, m_SendOpt, ac))->post();
return CALL_E_PENDDING;
}
View
@@ -136,7 +136,7 @@ result_t Socket::close(AsyncEvent* ac)
if (ac->isSync())
return CHECK_ERROR(CALL_E_NOSYNC);
return m_aio.close(m_aio.m_fd, ac);
return m_aio.close(ac);
}
result_t Socket::get_family(int32_t& retVal)

0 comments on commit e71a1bf

Please sign in to comment.