mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-03 03:30:06 +00:00
New methods for PropertiesFile. Fix for InterprocessConnection.
This commit is contained in:
parent
7228c6b593
commit
d9d1c4c995
7 changed files with 92 additions and 55 deletions
|
|
@ -281,27 +281,27 @@ bool InterprocessConnection::readNextMessageInt()
|
|||
if (bytes == sizeof (messageHeader)
|
||||
&& ByteOrder::swapIfBigEndian (messageHeader[0]) == magicMessageHeader)
|
||||
{
|
||||
const int bytesInMessage = (int) ByteOrder::swapIfBigEndian (messageHeader[1]);
|
||||
int bytesInMessage = (int) ByteOrder::swapIfBigEndian (messageHeader[1]);
|
||||
|
||||
if (bytesInMessage > 0 && bytesInMessage < maximumMessageSize)
|
||||
{
|
||||
MemoryBlock messageData (bytesInMessage, true);
|
||||
int bytesRead = 0;
|
||||
|
||||
while (bytesRead < bytesInMessage)
|
||||
while (bytesInMessage > 0)
|
||||
{
|
||||
if (threadShouldExit())
|
||||
return false;
|
||||
|
||||
const int numThisTime = jmin (bytesInMessage, 65536);
|
||||
const int bytesIn = (socket != 0) ? socket->read (((char*) messageData.getData()) + bytesRead, numThisTime, true)
|
||||
: pipe->read (((char*) messageData.getData()) + bytesRead, numThisTime,
|
||||
pipeReceiveMessageTimeout);
|
||||
const int bytesIn = (socket != 0) ? socket->read (static_cast <char*> (messageData.getData()) + bytesRead, numThisTime, true)
|
||||
: pipe->read (static_cast <char*> (messageData.getData()) + bytesRead, numThisTime, pipeReceiveMessageTimeout);
|
||||
|
||||
if (bytesIn <= 0)
|
||||
break;
|
||||
|
||||
bytesRead += bytesIn;
|
||||
bytesInMessage -= bytesIn;
|
||||
}
|
||||
|
||||
if (bytesRead >= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue