--- trunk/FlisServer/Serial.cpp 2007/11/30 16:07:03 112 +++ trunk/FlisServer/Serial.cpp 2007/12/01 14:18:33 113 @@ -111,7 +111,9 @@ if (mIsopen) { while (getComstat().cbOutQue >0) + { Sleep(5); + } SetCommState(mComport,&mDcbRestore); CloseHandle(mComport); mIsopen = false; @@ -125,7 +127,9 @@ unsigned long size; if (!mIsopen) + { throw std::exception("Port not opened"); + } ReadFile(mComport,&out,1,&size,0); // Error check. @@ -135,7 +139,7 @@ CloseHandle(mComport); throw std::exception(error.c_str()); } - + //printByte("Read", out); return out;