kernel: Use a did_close callback for UnixSockets
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
b77b72a551
commit
97d7a7cc6b
@ -11,12 +11,18 @@ UnixSocket::UnixSocket(UnixSocket* peer) : m_state(State::Connected), m_peer(pee
|
|||||||
}
|
}
|
||||||
|
|
||||||
UnixSocket::~UnixSocket()
|
UnixSocket::~UnixSocket()
|
||||||
|
{
|
||||||
|
did_close();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UnixSocket::did_close()
|
||||||
{
|
{
|
||||||
if (m_peer)
|
if (m_peer)
|
||||||
{
|
{
|
||||||
m_peer->m_peer = nullptr;
|
m_peer->m_peer = nullptr;
|
||||||
m_peer->m_state = State::Reset;
|
m_peer->m_state = State::Reset;
|
||||||
}
|
}
|
||||||
|
m_state = State::Inactive;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnixSocket::connect_to_peer(UnixSocket* peer)
|
void UnixSocket::connect_to_peer(UnixSocket* peer)
|
||||||
|
@ -21,6 +21,8 @@ class UnixSocket : public Socket
|
|||||||
Result<void> bind(SharedPtr<Socket>, struct sockaddr*, socklen_t) override;
|
Result<void> bind(SharedPtr<Socket>, struct sockaddr*, socklen_t) override;
|
||||||
Result<void> connect(struct sockaddr*, socklen_t) override;
|
Result<void> connect(struct sockaddr*, socklen_t) override;
|
||||||
|
|
||||||
|
void did_close() override;
|
||||||
|
|
||||||
void connect_to_peer(UnixSocket* peer);
|
void connect_to_peer(UnixSocket* peer);
|
||||||
|
|
||||||
virtual ~UnixSocket();
|
virtual ~UnixSocket();
|
||||||
|
Loading…
Reference in New Issue
Block a user