IXWebSocket/ixwebsocket/IXSocketConnect.h

34 lines
821 B
C
Raw 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
{
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-15 01:28:11 +01:00
private:
static bool connectToAddress(const struct addrinfo *address,
int& sockfd,
std::string& errMsg,
2018-12-15 01:28:11 +01:00
const CancellationRequest& isCancellationRequested);
static void configure(int sockfd);
};
}