asio icon indicating copy to clipboard operation
asio copied to clipboard

(In progress) Define port_t type for endpoint's port number

Open tiendq opened this issue 6 years ago • 1 comments

Just inspired by size_t, would it be a little more readable to use port_t instead of unsigned short? If yes I'll check and update everywhere.

And it can be used in consumer code too, for example:

class ServerBase {
public:
  ServerBase(boost::asio::port_t port = 8000) {}
};

tiendq avatar Jan 17 '19 04:01 tiendq

POSIX calls this type in_port_t. http://pubs.opengroup.org/onlinepubs/000095399/basedefs/netinet/in.h.html

viccpp avatar Jan 21 '19 12:01 viccpp