Add Unix domain sockets for local IPC #37

Merged
apio merged 16 commits from unix-sockets into main 2023-07-30 09:49:38 +00:00
2 changed files with 8 additions and 0 deletions
Showing only changes of commit 7a7ae086f5 - Show all commits

View File

@ -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)

View File

@ -21,6 +21,8 @@ class UnixSocket : public Socket
Result<void> bind(SharedPtr<Socket>, struct sockaddr*, socklen_t) override;
Result<void> connect(struct sockaddr*, socklen_t) override;
void did_close() override;
void connect_to_peer(UnixSocket* peer);
virtual ~UnixSocket();