Add socket library
This commit is contained in:
24
SocketLibrary/Socket.h
Normal file
24
SocketLibrary/Socket.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
#include <WinSock2.h>
|
||||
|
||||
#include "ipVersion.h"
|
||||
#include "Result.h"
|
||||
#include "SocketOption.h"
|
||||
|
||||
namespace SocketLibrary
|
||||
{
|
||||
class Socket
|
||||
{
|
||||
public:
|
||||
Socket(IPVersion ipversion = IPVersion::IPv4, SOCKET socket = INVALID_SOCKET); //(..., SocketHandle handle)
|
||||
Result Create();
|
||||
Result Close();
|
||||
SOCKET GetSocket(); //SocketHandle GetHandle()
|
||||
IPVersion GetIpVersion();
|
||||
private:
|
||||
Result SetSocketOption(SocketOption option, BOOL value);
|
||||
IPVersion _ipversion = IPVersion::IPv4;
|
||||
SOCKET _socket = INVALID_SOCKET;
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user