30 class InterprocessConnectionServer;
75 uint32 magicMessageHeaderNumber = 0xf2b49e2c);
92 bool connectToSocket (
const String& hostName,
94 int timeOutMillisecs);
108 bool connectToPipe (
const String& pipeName,
int pipeReceiveMessageTimeoutMs);
122 bool createPipe (
const String& pipeName,
int pipeReceiveMessageTimeoutMs,
bool mustNotExist =
false);
128 bool isConnected()
const;
139 String getConnectedHostName()
const;
159 virtual void connectionMade() = 0;
167 virtual void connectionLost() = 0;
180 virtual void messageReceived (
const MemoryBlock& message) = 0;
186 std::unique_ptr<StreamingSocket> socket;
187 std::unique_ptr<NamedPipe> pipe;
188 bool callbackConnectionState =
false;
189 const bool useMessageThread;
190 const uint32 magicMessageHeader;
191 int pipeReceiveMessageTimeout = -1;
196 void deletePipeAndSocket();
197 void connectionMadeInt();
198 void connectionLostInt();
200 bool readNextMessage();
201 int readData (
void*,
int);
203 struct ConnectionThread;
204 std::unique_ptr<ConnectionThread> thread;
205 std::atomic<bool> threadIsRunning {
false };
208 int writeData (
void*,
int);
210 JUCE_DECLARE_WEAK_REFERENCEABLE (InterprocessConnection)
211 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InterprocessConnection)