Пример #1
0
int DoClient(int sock) {
	char req[4096];
	int size;

	while(1) {
		size = GetRequest(sock, req);
		if(size < 0 ) {
			printf("Get request failed\n");
			return 0;
		}
		DealRequest(sock, req);
	}
}
Пример #2
0
bool IHomeSession::StartSession(int sock)
{
    Request *req;
    req = new Request;
    while(!bQuit)
    {
        if(!GetRequest(req,sock))
        {
            break;
        }
        DealRequest(req,sock);
       if(req->bodyLen > 0)
        {
            delete []req->body;
        }
    }
    return true;
}