| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #pragma once
- #include "../Core/Mutex.h"
- #include "../Core/Thread.h"
- #include "../Core/Object.h"
- #include "IPC.h"
- #include "IPCMessage.h"
- #include "IPCUnix.h"
- #ifdef ATOMIC_PLATFORM_WINDOWS
- // Windows defines PostMessage as PostMessgeA/W
- #undef PostMessage
- #endif
- namespace Atomic
- {
- class IPCChannel : public Object, public Thread
- {
- OBJECT(IPCChannel)
- public:
- IPCChannel(Context* context);
- virtual ~IPCChannel();
- virtual void ThreadFunction() {}
- bool Receive();
- void PostMessage(StringHash eventType, VariantMap& eventData);
- protected:
- // for access from thread
- WeakPtr<IPC> ipc_;
- // for brokers this is the worker process
- // for workers, the broker process
- SharedPtr<IPCProcess> otherProcess_;
- PipeTransport transport_;
- IPCMessageHeader currentHeader_;
- VectorBuffer dataBuffer_;
- };
- }
|