chunks have shorts

git-svn-id: svn://elaine/murooma/trunk@53 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-07-03 18:46:52 +00:00
parent f444f63d25
commit 4d798b701c
3 changed files with 29 additions and 11 deletions

View file

@ -30,7 +30,7 @@ int main () {
// Initialize random number generator
size_t idx(0);
char c;//[2];
char c[2];
Chunk chunk;
timeval ts;
ts.tv_sec = 0;
@ -38,10 +38,11 @@ int main () {
timeval last;
gettimeofday(&last, NULL);
last.tv_sec -= 1000;
while (!cin.get(c).eof())
while (true)
{
// read(fd, &msg[0], size);
chunk.payload[idx++] = c;
c[0] = cin.get();
c[1] = cin.get();
chunk.payload[idx++] = c[0] + (c[1] << 8);
if (idx == WIRE_CHUNK_SIZE)
{
timeval now;