Removing named namespace from code base.
This commit is contained in:
1 parent
678795b793
commit
4180622d6a
158 files changed
+12260
-12648
No files matched your search
@@ -1,56 +1,53 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <Core/Networking/SocketHandle.h>
|
||||
|
||||
namespace Juliet
|
||||
class Socket
|
||||
{
|
||||
class Socket
|
||||
public:
|
||||
virtual ~Socket();
|
||||
|
||||
Socket(Socket&& other) noexcept;
|
||||
Socket& operator=(Socket&& socket) noexcept;
|
||||
|
||||
Socket(const Socket&) = delete;
|
||||
Socket& operator=(const Socket&) = delete;
|
||||
|
||||
bool IsValid() const;
|
||||
|
||||
enum class Status : uint8
|
||||
{
|
||||
public:
|
||||
virtual ~Socket();
|
||||
|
||||
Socket(Socket&& other) noexcept;
|
||||
Socket& operator=(Socket&& socket) noexcept;
|
||||
|
||||
Socket(const Socket&) = delete;
|
||||
Socket& operator=(const Socket&) = delete;
|
||||
|
||||
bool IsValid() const;
|
||||
|
||||
enum class Status : uint8
|
||||
{
|
||||
Done,
|
||||
Partial,
|
||||
Ready,
|
||||
NotReady,
|
||||
Disconnected,
|
||||
Error
|
||||
};
|
||||
|
||||
protected:
|
||||
enum class Protocol : uint8
|
||||
{
|
||||
TCP,
|
||||
UDP
|
||||
};
|
||||
|
||||
// To store the result of a send/receive on the socket
|
||||
struct RequestStatus
|
||||
{
|
||||
Status Status = Status::Done;
|
||||
size_t Length = 0;
|
||||
};
|
||||
|
||||
explicit Socket(Protocol protocol);
|
||||
|
||||
SocketHandle GetHandle() const { return Handle; }
|
||||
|
||||
void Create();
|
||||
void CreateFromHandle(SocketHandle handle);
|
||||
void Close();
|
||||
|
||||
private:
|
||||
SocketHandle Handle;
|
||||
Protocol ProtocolType;
|
||||
Done,
|
||||
Partial,
|
||||
Ready,
|
||||
NotReady,
|
||||
Disconnected,
|
||||
Error
|
||||
};
|
||||
} // namespace Juliet
|
||||
|
||||
protected:
|
||||
enum class Protocol : uint8
|
||||
{
|
||||
TCP,
|
||||
UDP
|
||||
};
|
||||
|
||||
// To store the result of a send/receive on the socket
|
||||
struct RequestStatus
|
||||
{
|
||||
Status Status = Status::Done;
|
||||
size_t Length = 0;
|
||||
};
|
||||
|
||||
explicit Socket(Protocol protocol);
|
||||
|
||||
SocketHandle GetHandle() const { return Handle; }
|
||||
|
||||
void Create();
|
||||
void CreateFromHandle(SocketHandle handle);
|
||||
void Close();
|
||||
|
||||
private:
|
||||
SocketHandle Handle;
|
||||
Protocol ProtocolType;
|
||||
};
|
||||
Reference in new issue
Block a user