int NamedPipeClass::Write(unsigned char * buffer, unsigned int bufferLen)
{
return write(pipeForWritingDescriptor, buffer, bufferLen);
}
int NamedPipeClass::ReadingThread()
{
unsigned char buf[MAX_BUF];
ssize_t bytesReaded = 0;
while(!bExit)
{
memset(buf,0,MAX_BUF);
bytesReaded = read(pipeForReadingDescriptor, buf, MAX_BUF);
if(bytesReaded>0)
{
if(onRead!=NULL)
onRead(buf, bytesReaded, this);
}
}
return 0;
}