diff options
author | Ben Burwell <bburwell1@gmail.com> | 2013-05-01 18:54:35 -0400 |
---|---|---|
committer | Ben Burwell <bburwell1@gmail.com> | 2013-05-01 18:54:35 -0400 |
commit | c112d966e58b3b6c314cc2b87d0891d946aa235a (patch) | |
tree | c0ab393428b63a283b2fc0e24ae66b1b2848b987 | |
parent | a08e54f9a39177c48fe797e3f60ffadd17ae380d (diff) |
Adds comments
-rw-r--r-- | loading.h | 5 | ||||
-rw-r--r-- | localchat.c | 9 |
2 files changed, 12 insertions, 2 deletions
@@ -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 |