26class InterprocessConnectionServer;
74 uint32 magicMessageHeaderNumber = 0xf2b49e2c);
91 bool connectToSocket (
const String& hostName,
93 int timeOutMillisecs);
107 bool connectToPipe (
const String& pipeName,
int pipeReceiveMessageTimeoutMs);
121 bool createPipe (
const String& pipeName,
int pipeReceiveMessageTimeoutMs,
bool mustNotExist =
false);
134 void disconnect (
int timeoutMs = -1, Notify notify = Notify::yes);
137 bool isConnected()
const;
148 String getConnectedHostName()
const;
195 std::unique_ptr<StreamingSocket> socket;
196 std::unique_ptr<NamedPipe> pipe;
197 bool callbackConnectionState =
false;
198 const bool useMessageThread;
199 const uint32 magicMessageHeader;
200 int pipeReceiveMessageTimeout = -1;
204 void initialiseWithSocket (std::unique_ptr<StreamingSocket>);
205 void initialiseWithPipe (std::unique_ptr<NamedPipe>);
206 void deletePipeAndSocket();
207 void connectionMadeInt();
208 void connectionLostInt();
210 bool readNextMessage();
211 int readData (
void*,
int);
213 struct ConnectionThread;
214 std::unique_ptr<ConnectionThread> thread;
215 std::atomic<bool> threadIsRunning {
false };
218 std::shared_ptr<SafeAction> safeAction;
221 int writeData (
void*,
int);
virtual void connectionMade()=0
virtual void messageReceived(const MemoryBlock &message)=0
StreamingSocket * getSocket() const noexcept
virtual void connectionLost()=0
NamedPipe * getPipe() const noexcept