aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Burwell <bburwell1@gmail.com>2013-05-01 17:23:15 -0400
committerBen Burwell <bburwell1@gmail.com>2013-05-01 17:23:15 -0400
commit0618afcfe7b12abf36b7bcc067baf6dd054489ae (patch)
tree36091e5676acd6df92b9590764a856a16e2424fd
parenta62c541dd233da2d2bd178f38aaf474032dc6add (diff)
Adds RR functionality
-rw-r--r--loading.h18
-rw-r--r--localchat.c7
2 files changed, 23 insertions, 2 deletions
diff --git a/loading.h b/loading.h
index 6aa43de..a9d7701 100644
--- a/loading.h
+++ b/loading.h
@@ -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"