Commit d912b16b authored by Tom Niget's avatar Tom Niget

Fix socket.hpp build

parent ab844a5f
......@@ -7,6 +7,7 @@
#include "builtins.hpp"
#include <netinet/in.h>
#include <netdb.h>
#include <tuple>
namespace py_socket {
......@@ -99,7 +100,9 @@ struct socket_t {
hints.ai_protocol = proto;
hints.ai_flags = flags;
addrinfo *res;
if (int err = ::getaddrinfo(host.c_str(), port.c_str(), &hints, &res); err != 0) {
// convert port to string
std::string port_str = std::to_string(port);
if (int err = ::getaddrinfo(host.c_str(), port_str.c_str(), &hints, &res); err != 0) {
system_error(err, "getaddrinfo()");
}
return res;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment