2009-10-18から1日間の記事一覧

マルチスレッドでのechoサーバ

マルチスレッドでのechoサーバのメモserver.cc #include <iostream> #include <sstream> #include <pthread.h> #include "ServerSocket.h" #include "Queue.h" using namespace std; string readLine(int sock){ char c; stringstream buffer; while(1){ int ret = read(sock, &c , 1); if(</pthread.h></sstream></iostream>…