28 unsigned long converted = 0;
30 converted = std::stoul(portStr);
31 }
catch (
const std::exception&) {
32 throw std::runtime_error(
33 "Couldn't convert " + portStr +
" to port number.");
36 if (converted == 0 && !serverSide) {
37 throw std::runtime_error(
"Port 0 is not valid for client ports.");
39 return static_cast<uint16_t>(converted);
41 throw std::runtime_error(
42 "Couldn't convert " + portStr +
" to port number.");
56 std::vector<std::string>
argv,
57 FizzArgHandlerMap handlers,
58 std::function<
void()> usageFunc);
65 virtual void write(std::unique_ptr<folly::IOBuf> msg) = 0;
66 virtual void close() = 0;
67 virtual bool connected()
const = 0;
void write(const T &in, folly::io::Appender &appender)
requires E e noexcept(noexcept(s.error(std::move(e))))
int close(NetworkSocket s)