* Returns an instance of a `Socket` using the specified kind of * implementation. * * @param s Optional. The file descriptor to wrap with the `Socket`. * @param kind Optional. The desired `Socket` implementation. * * @return An instance of a `Socket`. */
| 266 | * @return An instance of a `Socket`. |
| 267 | */ |
| 268 | static Try<Socket> create( |
| 269 | int_fd s, |
| 270 | SocketImpl::Kind kind = SocketImpl::DEFAULT_KIND()) |
| 271 | { |
| 272 | Try<std::shared_ptr<SocketImpl>> impl = SocketImpl::create(s, kind); |
| 273 | if (impl.isError()) { |
| 274 | return Error(impl.error()); |
| 275 | } |
| 276 | return Socket(impl.get()); |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * Returns an instance of a `Socket` using `AddressType` to determine |