[+] IPCPipe::GetCurrentSharedDuplexHandles()

This commit is contained in:
Reece Wilson 2023-07-29 08:52:33 +01:00
parent 7e2aa2de3d
commit 4ad2a54ccf
3 changed files with 24 additions and 6 deletions

View File

@ -19,19 +19,31 @@ namespace Aurora::IO::IPC
/**
* @brief A UNIX loopsource indicating when the pipe has data available.
* Wait semantics will be simlulated on Windows with a constant-step timer.
* @return
* @warning unimplemented on windows. IsSignaled()-as-has-data works nonblocking, though.
* Wait semantics will be simulated on Windows with a constant-step timer.
* @warning waiting is unimplemented on windows. IsSignaled()-as-has-data works though.
* @warning you should therefore not poll against 'has data'.
* @warning use ::NewAsyncTransaction() to read from the duplex pipe instead.
*/
virtual AuSPtr<Loop::ILoopSource> AsReadChannelHasData() = 0;
/**
* @brief Returns a shared async file interface to a session between the server
* Undefined behaviour is expected while AsReadChannelIsOpen()->IsSignaled() is false.
* @return
* @brief Returns a shared async file interface to a full-duplex pipe between both ends
*
* Undefined behaviour is expected while AsReadChannelIsOpen()->IsSignaled() is false
* You must only start reading once you have established readiness of the connection!
* You must poll against the AsReadChannelIsOpen() source first!
*/
virtual AuSPtr<IO::IAsyncTransaction> NewAsyncTransaction() = 0;
/**
* @brief Returns a shared blocking file handle to a full-duplex pipe between both ends
*
* Undefined behaviour is expected while AsReadChannelIsOpen()->IsSignaled() is false
* You must only start reading once you have established readiness of the connection!
* You must poll against the AsReadChannelIsOpen() source first!
*/
virtual AuSPtr<IO::IIOHandle> GetCurrentSharedDuplexHandles() = 0;
/**
* @brief Reads at least write.length from the outbound stream of the opposite end
* @param nonblocking Wait for data

View File

@ -182,6 +182,11 @@ namespace Aurora::IO::IPC
return transaction;
}
AuSPtr<IO::IIOHandle> IPCPipeImpl::GetCurrentSharedDuplexHandles()
{
return this->fsHandle_;
}
bool IPCPipeImpl::Read(const Memory::MemoryViewStreamWrite &write, bool nonblocking)
{
DWORD size = write.length;

View File

@ -24,6 +24,7 @@ namespace Aurora::IO::IPC
PROXY_INTERNAL_INTERFACE_(LSHandle::)
virtual AuSPtr<IO::IAsyncTransaction> NewAsyncTransaction() override;
virtual AuSPtr<IO::IIOHandle> GetCurrentSharedDuplexHandles() override;
virtual AuSPtr<Loop::ILoopSource> AsReadChannelIsOpen() override;
virtual AuSPtr<Loop::ILoopSource> AsReadChannelHasData() override;