Integrated std::byte added to C++17 recently
This commit is contained in:
TheDoctor
2019-10-15 21:03:24 +01:00
parent 8fbda17074
commit 5ab59a6fb8
49 changed files with 424 additions and 427 deletions

View File

@ -1,6 +1,6 @@
#pragma once
#include "VoidNet/Socket.hpp"
#include "VoidNet_LL/Socket.hpp"
//#include <openssl/rand.h>
//#include <openssl/ssl.h>
@ -16,23 +16,23 @@ namespace std::net
bool Connect(const IPAddress& addr);
bool Close() const;
bool HasPendingData(uint32_t& pendingDataSize) const;
bool Send(uint8_t* data, int32_t count, int32_t &sent, int flags = 0); // Execute 1 write() syscall
bool Recv(uint8_t* data, int32_t count, int32_t &read, int flags = 0); // Execte 1 read() syscall
bool Wait(SocketWaitConditions cond, std::chrono::milliseconds t) const;
bool Send(byte* data, int32_t count, int32_t &sent, int flags = 0); // Execute 1 write() syscall
bool Recv(byte* data, int32_t count, int32_t &read, int flags = 0); // Execte 1 read() syscall
bool Wait(SocketWaitConditions cond, chrono::milliseconds t) const;
SocketConnectionState GetConnectionState() const;
void GetAddress(IPAddress& outAddr) const;
int32_t GetPort() const;
void UseCertificateFile(std::string const& path);
void UsePrivateKeyFile(std::string const& path);
void UseCertificateFile(string const& path);
void UsePrivateKeyFile(string const& path);
private:
bool SendRaw(uint8_t* buf, size_t len, int flags = 0);
bool SendRaw(byte* buf, size_t len, int flags = 0);
bool SendFromBio(int flags = 0);
bool RecvToBio(int flags = 0);
void HandleReturn(size_t ret);
std::unique_ptr<Socket> m_socket;
unique_ptr<Socket> m_socket;
//SSL_CTX* m_context;
//SSL* m_conn;