IXWebSocket/ixwebsocket/IXSocketConnect.h

32 lines
784 B
C
Raw Permalink Normal View History

/*
* IXSocketConnect.h
* Author: Benjamin Sergeant
* Copyright (c) 2018 Machine Zone, Inc. All rights reserved.
*/
#pragma once
2018-12-15 01:28:11 +01:00
#include "IXCancellationRequest.h"
#include <string>
struct addrinfo;
namespace ix
{
2019-05-30 17:46:50 +02:00
class SocketConnect
{
public:
static int connect(const std::string& hostname,
int port,
std::string& errMsg,
2018-12-15 01:28:11 +01:00
const CancellationRequest& isCancellationRequested);
2018-12-30 08:15:27 +01:00
static void configure(int sockfd);
2018-12-15 01:28:11 +01:00
private:
2019-05-30 17:46:50 +02:00
static int connectToAddress(const struct addrinfo* address,
std::string& errMsg,
const CancellationRequest& isCancellationRequested);
};
2019-05-30 17:46:50 +02:00
} // namespace ix