This commit is contained in:
Martin Slachta
2026-07-18 14:31:15 +02:00
commit a04f0dc262
3343 changed files with 1140208 additions and 0 deletions
@@ -0,0 +1,13 @@
#pragma once
#include <exception>
namespace tw::net {
class ByteBufferOverflowException : public std::exception {
const char* what() const noexcept override {
return "Byte buffer overflow";
}
};
}
@@ -0,0 +1,13 @@
#pragma once
#include <exception>
namespace tw::net {
class SocketClosedException : public std::exception {
public:
const char* what() const noexcept override {
return "Socket closed";
}
};
}
@@ -0,0 +1,29 @@
#pragma once
#include <cstring>
#include <exception>
namespace tw::net {
class SocketException : public std::exception {
int m_errno;
public:
int errno() {
return m_errno;
}
SocketException() {
}
SocketException(int errno) :
m_errno(errno)
{ }
const char* what() const noexcept override {
return std::strerror(m_errno);
}
};
}