Skip to content

Commit

Permalink
Copy socket and remove shared_from_this
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacquwes committed Sep 28, 2023
1 parent d04215c commit c7f0d49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions shared/include/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
namespace pine
{
/// @brief A connection base class that is used by the server and the client.
class connection : public std::enable_shared_from_this<connection>
class connection
{
public:
/// @brief Construct a connection with the given socket.
connection(asio::ip::tcp::socket& socket);
connection(asio::ip::tcp::socket socket);

/// @brief Destroy the connection.
virtual ~connection();
Expand Down
2 changes: 1 addition & 1 deletion shared/src/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace pine
{
connection::connection(asio::ip::tcp::socket& socket) :
connection::connection(asio::ip::tcp::socket socket) :
socket(std::move(socket))
{
std::cout << "New connection: " << id << std::endl;
Expand Down

0 comments on commit c7f0d49

Please sign in to comment.