diff --git a/BoundedBuffer.cpp b/BoundedBuffer.cpp index 40f1516..09d1da8 100755 --- a/BoundedBuffer.cpp +++ b/BoundedBuffer.cpp @@ -18,5 +18,4 @@ string BoundedBuffer::pop(){ data.pop_back(); empty->V(); return item; -} - \ No newline at end of file +} \ No newline at end of file diff --git a/BoundedBuffer.h b/BoundedBuffer.h index f058c87..46b1227 100755 --- a/BoundedBuffer.h +++ b/BoundedBuffer.h @@ -31,6 +31,8 @@ public: } void set_b(int b){ b_val = b;} + + int get_val(){ return b_val; } void push(string item); @@ -40,4 +42,4 @@ public: //b = user input }; -#endif +#endif diff --git a/dataserver.cpp b/dataserver.cpp index df2a709..2f91bd8 100755 --- a/dataserver.cpp +++ b/dataserver.cpp @@ -158,6 +158,7 @@ void handle_process_loop(RequestChannel & _channel) { cout << "New request is " << request << endl; if (request.compare("quit") == 0) { + cout << "\nquit\n"; _channel.cwrite("bye"); usleep(10000); // give the other end a bit of time. break; // break out of the loop; diff --git a/simpleclient.cpp b/simpleclient.cpp index 6e0ebcc..80bba0d 100755 --- a/simpleclient.cpp +++ b/simpleclient.cpp @@ -109,8 +109,8 @@ int main(int argc, char * argv[]) { string channel_name; for(int i=0; i < w; i++){ - channel_name = chan.send_request("newthread"); - cout << "Chan: " << channel_name << endl; + channel_name = chan.send_request("newthrread"); + cout << "\nChan: " << channel_name << endl; RequestChannel* worker_ret = new RequestChannel(channel_name, RequestChannel::CLIENT_SIDE); Worker_Thread(argv, worker_ret); } @@ -135,7 +135,7 @@ void* Worker_Thread(char* arg[], RequestChannel* chan){ //control chan("control", RequestChannel::CLIENT_SIDE); //string channel_name = control.send_request("newthread"); //RequestChannel * channel_ret = new RequestChannel(channel_name, RequestChannel::CLIENT_SIDE); - while(true){ + while(Request_Buffer->get_val() != 0){ string req = Request_Buffer->pop();