StormByte C++ Library: Network module 0.0.9999
StormByte-Network is a StormByte library module for handling and create network connections
Loading...
Searching...
No Matches
client.hxx
1#pragma once
2
3#include <StormByte/network/endpoint.hxx>
4#include <StormByte/network/packet.hxx>
5
15 class STORMBYTE_NETWORK_PUBLIC Client: public EndPoint {
16 public:
22 Client(const Connection::Protocol& protocol, std::shared_ptr<Connection::Handler> handler, std::shared_ptr<Logger> logger) noexcept;
23
28 Client(const Client& other) = delete;
29
34 Client(Client&& other) noexcept = default;
35
39 virtual ~Client() noexcept override = default;
40
46 Client& operator=(const Client& other) = delete;
47
53 Client& operator=(Client&& other) noexcept = default;
54
62 virtual ExpectedVoid Connect(const std::string& hostname, const unsigned short& port) noexcept override;
63
68 ExpectedPacket Receive() noexcept;
69
75 ExpectedVoid Send(const Packet& packet) noexcept;
76 };
77}
The class representing a client.
Definition client.hxx:15
virtual ~Client() noexcept override=default
The destructor of the Client class.
Client(const Client &other)=delete
The copy constructor of the Client class.
Client(Client &&other) noexcept=default
The move constructor of the Client class.
Client(const Connection::Protocol &protocol, std::shared_ptr< Connection::Handler > handler, std::shared_ptr< Logger > logger) noexcept
The constructor of the Client class.
Represents a network endpoint, serving as a base class for both clients and servers.
Definition endpoint.hxx:20
Represents a network packet.
Definition packet.hxx:21
Contains all the network-related classes and utilities.
Definition client.hxx:10
StormByte::Expected< std::shared_ptr< Packet >, PacketError > ExpectedPacket
The expected packet type.
Definition typedefs.hxx:38
StormByte::Expected< void, ConnectionError > ExpectedVoid
The expected void type.
Definition typedefs.hxx:32