Commit 50842841 authored by Saikumar's avatar Saikumar

Updated server.cpp

parent fbfb08c5
......@@ -52,8 +52,8 @@ void *respondToClient(void *args) {
string key_string, value_string;
switch(todo) {
case '1':
// printf("GET recvd\n");
// printf("Key: %s\n", key);
// printf("GET :\n");
printf("Key: %s\n", key);
// j = search(key);
// printf("j=%d\n", j);
key_string = key;
......@@ -67,9 +67,9 @@ void *respondToClient(void *args) {
write(clientFd, converted_output, output.length());
break;
case '2':
// printf("PUT recvd\n");
// printf("Key: %s\n", key);
// printf("Value: %s\n", value);
printf("PUT :\n");
printf("Key: %s\n", key);
printf("Value: %s\n", value);
key_string = key;
value_string = value;
// pthread_mutex_lock(&cLock);
......@@ -80,8 +80,8 @@ void *respondToClient(void *args) {
write(clientFd, converted_output, output.length());
break;
case '3':
// printf("DELETE recvd\n");
// printf("Key: %s\n", key);
printf("DELETE :\n");
printf("Key: %s\n", key);
key_string = key;
// pthread_mutex_lock(&cLock);
output = DEL(key_string);
......@@ -168,6 +168,7 @@ int main(int argc, char **argv) {
char ip[20], portNo[10];
int nThreads;
pthread_mutex_init(&lock, NULL);
initializeCache();
initVals(ip, portNo, &nThreads);
printf("Ip address: %s\n", ip);
printf("portno: %s\n", portNo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment