IXWebSocket/ixwebsocket/IXSocketConnect.h

32 lines
784 B
C
Raw Normal View History

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