| 237 | } |
| 238 | |
| 239 | std::shared_ptr<ReaderWriter> Socket::accept() const { |
| 240 | std::shared_ptr<Shared> out; |
| 241 | if (shared) { |
| 242 | shared->lock([&](SOCKET socket, const addrinfo*) { |
| 243 | if (socket != InvalidSocket) { |
| 244 | init(); |
| 245 | out = std::make_shared<Shared>(::accept(socket, 0, 0)); |
| 246 | out->setOptions(); |
| 247 | } |
| 248 | }); |
| 249 | } |
| 250 | return out; |
| 251 | } |
| 252 | |
| 253 | bool Socket::isOpen() const { |
| 254 | if (shared) { |