git-svn-id: svn://elaine/murooma/trunk@6 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-06-24 20:22:53 +00:00
parent 105ac263c0
commit 71949a8366
2 changed files with 20 additions and 3 deletions

View file

@ -12,6 +12,7 @@
#include <iostream>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
using namespace std;
@ -19,7 +20,7 @@ const int size(1024);
struct Chunk
{
time_t timestamp;
timeval timestamp;
char payload[size];
};
@ -37,7 +38,7 @@ int main () {
while (!cin.get(c).eof())
{
if (idx == 0)
time(&chunk.timestamp);
gettimeofday(&chunk.timestamp, 0);
// read(fd, &msg[0], size);
chunk.payload[idx++] = c;