* 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`. */
| 272 | * @return An instance of a `Socket`. |
| 273 | */ |
| 274 | static Try<Socket> create( |
| 275 | int_fd s, |
| 276 | SocketImpl::Kind kind = SocketImpl::DEFAULT_KIND()) |
| 277 | { |
| 278 | Try<std::shared_ptr<SocketImpl>> impl = SocketImpl::create(s, kind); |
| 279 | if (impl.isError()) { |
| 280 | return Error(impl.error()); |
| 281 | } |
| 282 | return Socket(impl.get()); |
| 283 | } |
| 284 | |
| 285 | /** |
| 286 | * Returns an instance of a `Socket` using `AddressType` to determine |