djumbai_client_receiver done?
This commit is contained in:
parent
897c8150a5
commit
7d554c6ee2
3 changed files with 60 additions and 45 deletions
|
@ -8,7 +8,7 @@ int new_message(message *m, unsigned int sender, unsigned int isgroup, unsigned
|
|||
m->header.sender = sender;
|
||||
m->header.isgroup = isgroup;
|
||||
m->header.receiver = receiver;
|
||||
time(&m->header.timestamp);
|
||||
gettimeofday(&m->header.timestamp,NULL);
|
||||
strncpy(m->content, content, MAX_CONTENT_SIZE);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define VERSION 1
|
||||
#define MAX_CONTENT_SIZE (PIPE_BUF - sizeof(struct MessageHeader))
|
||||
|
@ -20,7 +20,7 @@ typedef struct MessageHeader {
|
|||
// The receiver is either a user or a group
|
||||
unsigned int receiver;
|
||||
// The message was sent at this timestamp
|
||||
time_t timestamp;
|
||||
struct timeval timestamp;
|
||||
} message_header;
|
||||
|
||||
typedef struct Message {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue