provision for non-blocking comms

This commit is contained in:
mattijs
2009-08-11 23:08:00 +01:00
parent 5897f93196
commit 6b691f1776
3 changed files with 53 additions and 5 deletions

View File

@ -78,7 +78,15 @@ inline void Foam::IPstream::readFromBuffer
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::IPstream::~IPstream()
{}
{
if (bufPosition_ < messageSize_)
{
FatalErrorIn("IPstream::~IPstream()")
<< "Message not fully consumed. messageSize:" << messageSize_
<< " bytes of which only " << bufPosition_
<< " consumed." << Foam::abort(FatalError);
}
}

View File

@ -350,6 +350,31 @@ public:
return oldCommsType;
}
//- Transfer buffer
const List<char>& buf() const
{
return buf_;
}
//- Transfer buffer
List<char>& buf()
{
return buf_;
}
//- Current buffer read/write location
int bufPosition() const
{
return bufPosition_;
}
//- Current buffer read/write location
int& bufPosition()
{
return bufPosition_;
}
//- Exit program
static void exit(int errnum = 1);