server tick

git-svn-id: svn://elaine/murooma/trunk@109 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-07-27 13:50:02 +00:00
parent d684686b47
commit 146c856f03
2 changed files with 6 additions and 6 deletions

View file

@ -33,9 +33,9 @@ int main () {
timeval tvChunk;
gettimeofday(&tvChunk, NULL);
long nextTick = getTickCount();
while (cin.good())
while (!cin.bad())
{
for (size_t n=0; (n<WIRE_CHUNK_SIZE) && cin.good(); ++n)
for (size_t n=0; (n<WIRE_CHUNK_SIZE) && !cin.bad(); ++n)
{
c[0] = cin.get();
c[1] = cin.get();
@ -48,8 +48,8 @@ int main () {
zmq::message_t message(sizeof(Chunk));
memcpy(message.data(), chunk, sizeof(Chunk));
publisher.send(message);
addMs(tvChunk, WIRE_CHUNK_MS);
addMs(tvChunk, WIRE_CHUNK_MS);
nextTick += WIRE_CHUNK_MS;
long currentTick = getTickCount();
if (nextTick > currentTick)