~singpolyma/biboumi

9dd0cf8f7aee5c6d3be163246de9f0a5282e02e5 — louiz’ 7 years ago 89868e4
Fix an error on gcc 4.9, because it is so stupid it can’t find operator""s
1 files changed, 2 insertions(+), 4 deletions(-)

M louloulibs/network/tcp_server_socket.hpp
M louloulibs/network/tcp_server_socket.hpp => louloulibs/network/tcp_server_socket.hpp +2 -4
@@ 14,8 14,6 @@
#include <cstring>
#include <cassert>

using namespace std::string_literals;

template <typename RemoteSocketType>
class TcpSocketServer: public SocketHandler
{


@@ 24,11 22,11 @@ class TcpSocketServer: public SocketHandler
      SocketHandler(poller, -1)
  {
    if ((this->socket = ::socket(AF_INET6, SOCK_STREAM, 0)) == -1)
      throw std::runtime_error("Could not create socket: "s + std::strerror(errno));
      throw std::runtime_error(std::string{"Could not create socket: "} + std::strerror(errno));

    int opt = 1;
    if (::setsockopt(this->socket, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1)
      throw std::runtime_error("Failed to set socket option: "s + std::strerror(errno));
      throw std::runtime_error(std::string{"Failed to set socket option: "} + std::strerror(errno));

    struct sockaddr_in6 addr{};
    addr.sin6_family = AF_INET6;