{using Qt 4.7.4 with both MinGW 4.4.0 and Visual Studio 2010}

Requirement: An Application shares its data via overlapped, write-only, message mode pipe. It only writes to the pipe if update is required. I need to read this pipe if data is available and process the updated data else if no new data is available then process the last read data.

I'm new to the concepts of pipes in windows. From whatever little that i'v come to know by reading a few articles this is what i am doing:
Qt Code:
  1. //QLocalSocket namedPipe, QByteArray byteArray and QTimer timer are available as member variables.
  2. QString pipeName="Get it from Registry";
  3. connect(&namedPipe,SIGNAL(connected()),this,SLOT(sloConnected()));
  4. connect(&namedPipe,SIGNAL(error(QLocalSocket::LocalSocketError)),this,SLOT(sloConnectionError()));
  5. namedPipe.connectToServer(pipeName,QIODevice::ReadOnly);
  6.  
  7. void ClassName::sloConnected()
  8. {
  9. connect(&timer,SIGNAL(timeout()),this,SLOT(sloProcess()));
  10. timer.start(200); //i need to update my clients with the changed/unchanged data at regular intervals
  11. }
  12.  
  13. void ClassName::sloProcess()
  14. {
  15. if(namedPipe.bytesAvailable())
  16. byteArray=namedPipe.readAll();
  17. //deal with byteArray. if no bytes were available assume it'll contain valid data from one of the previous reads when data was available
  18. }
  19.  
  20. void ClassName::sloConnectionError()
  21. {
  22. qDebug() << "ERROR!!";
  23. }
To copy to clipboard, switch view to plain text mode 
The Application that creates and writes to the pipe keeps running. The problem is that when i close my program and re-run it, it prints "ERROR!!".
<1> Is it normal for the pipe to vanish after i've connected-to-it and/or attempt-to-read-it once?
<2> Am i doing something conceptually wrong here?
<3> Can you please give me a hint on better solution if this is wrong/poor?

Thanks !!