| 3 | using namespace NAsio; |
| 4 | |
| 5 | bool TOperationAccept::Execute(int errorCode) { |
| 6 | if (errorCode) { |
| 7 | H_(errorCode, *this); |
| 8 | |
| 9 | return true; |
| 10 | } |
| 11 | |
| 12 | struct sockaddr_storage addr; |
| 13 | socklen_t sz = sizeof(addr); |
| 14 | |
| 15 | SOCKET res = ::accept(Fd(), (sockaddr*)&addr, &sz); |
| 16 | |
| 17 | if (res == INVALID_SOCKET) { |
| 18 | H_(LastSystemError(), *this); |
| 19 | } else { |
| 20 | NS_.Assign(res, TEndpoint(new NAddr::TOpaqueAddr((sockaddr*)&addr))); |
| 21 | H_(0, *this); |
| 22 | } |
| 23 | |
| 24 | return true; |
| 25 | } |
nothing calls this directly
no test coverage detected