|
void | Connect () |
| Connects async. On success, m_Events will be broadcasted.
|
|
void | Disconnect () |
| Disconnect async. On completion, m_Events will be broadcasted.
|
|
bool | IsConnected () const |
| Returns whether we have a connection.
|
|
plEnum< ConnectionState > | GetConnectionState () const |
| Returns the current state of the connection.
|
|
bool | Send (plArrayPtr< const plUInt8 > data) |
| Sends a message. pMsg can be destroyed after the call.
|
|
void | SetReceiveCallback (ReceiveCallback callback) |
|
plResult | WaitForMessages (plTime timeout) |
| Block and wait for new messages and call ProcessMessages.
|
|
|
| plIpcChannel (plStringView sAddress, Mode::Enum mode) |
|
virtual bool | RequiresRegularTick () |
| Override this and return true, if the surrounding infrastructure should call the 'Tick()' function.
|
|
virtual void | Tick () |
| Can implement regular updates, e.g. for polling network state.
|
|
virtual void | InternalConnect ()=0 |
| Called on worker thread after Connect was called.
|
|
virtual void | InternalDisconnect ()=0 |
| Called on worker thread after Disconnect was called.
|
|
virtual void | InternalSend ()=0 |
| Called on worker thread to sent pending messages.
|
|
virtual bool | NeedWakeup () const =0 |
| Called by Send to determine whether the message loop need to be woken up.
|
|
void | SetConnectionState (plEnum< ConnectionState > state) |
|
void | ReceiveData (plArrayPtr< const plUInt8 > data) |
| Implementation needs to call this when new data has been received. data can be invalidated after the function.
|
|
void | FlushPendingOperations () |
|
Base class for a communication channel between processes.
The channel allows for byte blobs to be send back and forth between two processes. A client should only try to connect to a server once the server has changed to ConnectionState::Connecting as this indicates the server is ready to be conneccted to.
Use plIpcChannel:CreatePipeChannel to create an IPC pipe instance. To send more complex messages accross, you can create a plIpcProcessMessageProtocol on top of the channel.