From c112d966e58b3b6c314cc2b87d0891d946aa235a Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Wed, 1 May 2013 18:54:35 -0400 Subject: Adds comments --- loading.h | 5 +++++ localchat.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/loading.h b/loading.h index a9d7701..29662d8 100644 --- a/loading.h +++ b/loading.h @@ -7,10 +7,15 @@ void *rrf(void * arg) { + // wait predetermined interval sleep(RR); + + // print lyrics printf("\n Never gonna give you up \n"); printf(" Never gonna let you down \n"); printf(" Never gonna run around and desert you. \n"); + + // display prompt printf("%s ", prompt); fflush(stdout); diff --git a/localchat.c b/localchat.c index 83bab38..ad0ba17 100644 --- a/localchat.c +++ b/localchat.c @@ -37,22 +37,27 @@ struct peer peers[MAX_NUM_PEERS]; int num_peers_in_table = 0; pthread_mutex_t peer_table_lock; - + +// my flags char my_ip[64]; char in_chat[4] = "N"; const char * username; - + +// command line vars char command[256]; char prompt[16] = ">"; +// client socket int client_s; char in_buf[GLOBAL_MSG_LENGTH]; char out_buf[GLOBAL_MSG_LENGTH]; struct sockaddr_in client_addr; +// for accepting connections pending user approval int accepted_client; struct sockaddr_in accepted_addr; +// indicates whether needs to respond to a request int respond_to_chat_request = 0; // include functions -- cgit v1.2.3