| 488 | } |
| 489 | |
| 490 | int Accept(TStreamSocket* acceptedSock, ISockAddr* acceptedAddr = nullptr) { |
| 491 | SOCKET s = INVALID_SOCKET; |
| 492 | if (acceptedAddr) { |
| 493 | socklen_t acceptedSize = acceptedAddr->Size(); |
| 494 | s = accept((SOCKET) * this, acceptedAddr->SockAddr(), &acceptedSize); |
| 495 | } else { |
| 496 | s = accept((SOCKET) * this, nullptr, nullptr); |
| 497 | } |
| 498 | |
| 499 | if (s == INVALID_SOCKET) { |
| 500 | return -errno; |
| 501 | } |
| 502 | |
| 503 | TSocketHolder sock(s); |
| 504 | acceptedSock->Swap(sock); |
| 505 | return 0; |
| 506 | } |
| 507 | }; |
| 508 | |
| 509 | class TLocalDgramSocket: public TDgramSocket { |
no test coverage detected