diff options
author | Ben Burwell <bburwell1@gmail.com> | 2013-05-01 17:23:15 -0400 |
---|---|---|
committer | Ben Burwell <bburwell1@gmail.com> | 2013-05-01 17:23:15 -0400 |
commit | 0618afcfe7b12abf36b7bcc067baf6dd054489ae (patch) | |
tree | 36091e5676acd6df92b9590764a856a16e2424fd | |
parent | a62c541dd233da2d2bd178f38aaf474032dc6add (diff) |
Adds RR functionality
-rw-r--r-- | loading.h | 18 | ||||
-rw-r--r-- | localchat.c | 7 |
2 files changed, 23 insertions, 2 deletions
@@ -5,6 +5,19 @@ * Loading display */ +void *rrf(void * arg) { + + sleep(RR); + printf("\n Never gonna give you up \n"); + printf(" Never gonna let you down \n"); + printf(" Never gonna run around and desert you. \n"); + printf("%s ", prompt); + fflush(stdout); + + return; + +} + void loading() { printf(" Loading... 3"); @@ -21,4 +34,9 @@ void loading() { printf("\r Loading... Done.\n\n"); + if (RR) { + pthread_t rrt; + pthread_create(&rrt, NULL, rrf, NULL); + } + }
\ No newline at end of file diff --git a/localchat.c b/localchat.c index ddc73e1..226432f 100644 --- a/localchat.c +++ b/localchat.c @@ -22,10 +22,13 @@ // define constants #define DEBUG 0 #define MAX_NUM_PEERS 100 -#define CMD_PORT 6064 -#define CHAT_PORT 6065 +#define CMD_PORT 6060 +#define CHAT_PORT 6061 #define BROADCAST_IP "192.168.130.255" #define GLOBAL_MSG_LENGTH 1024 +#define REQUEST_TIMEOUT 10 +#define SESSION_TIMEOUT 30 +#define RR 0 // structs #include "peer.h" |