First import
This commit is contained in:
38
ixwebsocket/IXSocketAppleSSL.h
Normal file
38
ixwebsocket/IXSocketAppleSSL.h
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* IXSocketAppleSSL.h
|
||||
* Author: Benjamin Sergeant
|
||||
* Copyright (c) 2017-2018 Machine Zone, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IXSocket.h"
|
||||
|
||||
#include <Security/Security.h>
|
||||
#include <Security/SecureTransport.h>
|
||||
|
||||
#include <mutex>
|
||||
|
||||
namespace ix
|
||||
{
|
||||
class SocketAppleSSL : public Socket
|
||||
{
|
||||
public:
|
||||
SocketAppleSSL();
|
||||
~SocketAppleSSL();
|
||||
|
||||
virtual bool connect(const std::string& host,
|
||||
int port,
|
||||
std::string& errMsg) final;
|
||||
virtual void close() final;
|
||||
|
||||
virtual int send(char* buffer, size_t length) final;
|
||||
virtual int send(const std::string& buffer) final;
|
||||
virtual int recv(void* buffer, size_t length) final;
|
||||
|
||||
private:
|
||||
SSLContextRef _sslContext;
|
||||
mutable std::mutex _mutex; // AppleSSL routines are not thread-safe
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user