diff --git a/kernel/src/net/UnixSocket.cpp b/kernel/src/net/UnixSocket.cpp index c5514bd8..e389d50e 100644 --- a/kernel/src/net/UnixSocket.cpp +++ b/kernel/src/net/UnixSocket.cpp @@ -11,12 +11,18 @@ UnixSocket::UnixSocket(UnixSocket* peer) : m_state(State::Connected), m_peer(pee } UnixSocket::~UnixSocket() +{ + did_close(); +} + +void UnixSocket::did_close() { if (m_peer) { m_peer->m_peer = nullptr; m_peer->m_state = State::Reset; } + m_state = State::Inactive; } void UnixSocket::connect_to_peer(UnixSocket* peer) diff --git a/kernel/src/net/UnixSocket.h b/kernel/src/net/UnixSocket.h index f03959c1..0f376cbf 100644 --- a/kernel/src/net/UnixSocket.h +++ b/kernel/src/net/UnixSocket.h @@ -21,6 +21,8 @@ class UnixSocket : public Socket Result bind(SharedPtr, struct sockaddr*, socklen_t) override; Result connect(struct sockaddr*, socklen_t) override; + void did_close() override; + void connect_to_peer(UnixSocket* peer); virtual ~UnixSocket();