wsperf bug fixes, adds Xcode target

This commit is contained in:
Peter Thorson
2012-03-06 07:10:40 -06:00
parent 133a313b02
commit 301edcd948
6 changed files with 142 additions and 6 deletions

View File

@@ -58,6 +58,7 @@ public:
m_start = boost::chrono::steady_clock::now();
m_bytes = 0;
m_pass = RUNNING;
}
void mark() {
@@ -212,7 +213,8 @@ protected:
enum status {
FAIL = 0,
PASS = 1,
TIME_OUT = 2
TIME_OUT = 2,
RUNNING = 3
};
std::string m_name;

View File

@@ -90,6 +90,8 @@ public:
mark();
m_timer->cancel();
m_msg.reset();
m_pass = FAIL;
std::cout << "foo" << std::endl;
this->end(con);
}
@@ -98,7 +100,7 @@ public:
m_timer->cancel();
m_msg.reset();
this->end(con);
} else if (m_sync) {
} else if (m_sync && m_pass == RUNNING) {
con->send(m_msg);
}
}

View File

@@ -270,6 +270,9 @@ int main(int argc, char* argv[]) {
unsigned short port = 9002;
unsigned short num_threads = 2;
std::list<boost::shared_ptr<boost::thread> > threads;
std::list<boost::shared_ptr<boost::thread> >::iterator thit;
try {
if (argc == 2) {
std::stringstream buffer(argv[1]);
@@ -299,8 +302,6 @@ int main(int argc, char* argv[]) {
echo_endpoint.elog().set_level(websocketpp::log::elevel::ERROR);
echo_endpoint.elog().set_level(websocketpp::log::elevel::FATAL);
std::list<boost::shared_ptr<boost::thread> > threads;
for (int i = 0; i < num_threads; i++) {
threads.push_back(boost::shared_ptr<boost::thread>(new boost::thread(boost::bind(&process_requests, &rc))));
}