Skip to content

Commit

Permalink
src: set port in node_options to uint16_t
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Aug 13, 2023
1 parent b5da2f4 commit 0dd1eca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ class HostPort {

void set_host(const std::string& host) { host_name_ = host; }

void set_port(int port) { port_ = port; }
void set_port(uint16_t port) { port_ = port; }

const std::string& host() const { return host_name_; }

int port() const {
// TODO(joyeecheung): make port a uint16_t
uint16_t port() const {
CHECK_GE(port_, 0);
return port_;
}
Expand All @@ -45,7 +44,7 @@ class HostPort {

private:
std::string host_name_;
int port_;
uint16_t port_;
};

class Options {
Expand Down

0 comments on commit 0dd1eca

Please sign in to comment.