Nothing to do if this socket was never initialized.
| 161 | { |
| 162 | // Nothing to do if this socket was never initialized. |
| 163 | synchronized (lock) { |
| 164 | if (bev == nullptr) { |
| 165 | // If it was not initialized, then there should also be no |
| 166 | // requests. |
| 167 | CHECK(connect_request.get() == nullptr); |
| 168 | CHECK(recv_request.get() == nullptr); |
| 169 | CHECK(send_request.get() == nullptr); |
| 170 | |
| 171 | // We expect this to fail and generate an 'ENOTCONN' failure as |
| 172 | // no connection should exist at this point. |
| 173 | if (::shutdown(s, how) < 0) { |
| 174 | return SocketError(); |
| 175 | } |
| 176 | |
| 177 | return Nothing(); |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | // Extend the life-time of 'this' through the execution of the |
| 182 | // lambda in the event loop. Note: The 'self' needs to be explicitly |