Renamed Connection class to SoftwareConnection and added message type for adding a new scene graph.

This commit is contained in:
aniisaaden
2020-08-07 13:52:07 +02:00
parent 4c9b53c216
commit 02c7ebcec3
2 changed files with 130 additions and 36 deletions

View File

@@ -39,7 +39,7 @@
namespace openspace {
class Connection {
class SoftwareConnection {
public:
// Connection
enum class Status : uint32_t {
@@ -65,19 +65,19 @@ public:
std::vector<char> content;
};
class ConnectionLostError : public ghoul::RuntimeError {
class SoftwareConnectionLostError : public ghoul::RuntimeError {
public:
explicit ConnectionLostError();
explicit SoftwareConnectionLostError();
};
Connection(std::unique_ptr<ghoul::io::TcpSocket> socket);
SoftwareConnection(std::unique_ptr<ghoul::io::TcpSocket> socket);
// Connection
bool isConnectedOrConnecting() const;
void disconnect();
ghoul::io::TcpSocket* socket();
Connection::Message receiveMessage();
SoftwareConnection::Message receiveMessage();
static const unsigned int ProtocolVersion;
@@ -107,14 +107,14 @@ private:
struct Peer {
size_t id;
std::string name;
Connection connection;
Connection::Status status;
SoftwareConnection connection;
SoftwareConnection::Status status;
std::thread thread;
};
struct PeerMessage {
size_t peerId;
Connection::Message message;
SoftwareConnection::Message message;
};
// Server