2018-04-02 00:25:08 +00:00
|
|
|
#pragma once
|
|
|
|
#include "../../util/Serializable.h"
|
|
|
|
#include <iostream>
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
namespace ki
|
|
|
|
{
|
|
|
|
namespace protocol
|
|
|
|
{
|
|
|
|
namespace control
|
|
|
|
{
|
2018-04-03 16:02:30 +00:00
|
|
|
class ClientHello final : public util::Serializable
|
2018-04-02 00:25:08 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
ClientHello(uint16_t session_id = 0,
|
2018-04-09 20:49:11 +00:00
|
|
|
int32_t timestamp = 0, uint32_t milliseconds = 0);
|
2018-04-02 00:25:08 +00:00
|
|
|
virtual ~ClientHello() = default;
|
|
|
|
|
|
|
|
uint16_t get_session_id() const;
|
|
|
|
void set_session_id(uint16_t session_id);
|
|
|
|
|
2018-04-09 20:49:11 +00:00
|
|
|
int32_t get_timestamp() const;
|
|
|
|
void set_timestamp(int32_t timestamp);
|
2018-04-02 00:25:08 +00:00
|
|
|
|
|
|
|
uint32_t get_milliseconds() const;
|
|
|
|
void set_milliseconds(uint32_t milliseconds);
|
|
|
|
|
2018-04-03 16:02:30 +00:00
|
|
|
void write_to(std::ostream &ostream) const override final;
|
|
|
|
void read_from(std::istream &istream) override final;
|
|
|
|
size_t get_size() const override final;
|
2018-04-02 00:25:08 +00:00
|
|
|
private:
|
|
|
|
uint16_t m_session_id;
|
2018-04-09 20:49:11 +00:00
|
|
|
int32_t m_timestamp;
|
2018-04-02 00:25:08 +00:00
|
|
|
uint32_t m_milliseconds;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|