Panda3D

http_request.cxx

00001 #include "socket_base.h"
00002 
00003 
00004 #include "http_connection.h"
00005 #include "baseincomingset.h"
00006 #include "socket_base.h"
00007 
00008 
00009 #include "http_request.h"
00010 
00011 TypeHandle Http_Request::_type_handle;
00012 
00013 typedef BaseIncomingSet< Http_Request , Socket_TCP_Listen , char [10240], char *>  Http_Source_BaseIncomingSet;
00014 std::set< Http_Request * >                       Global_WebRequests_pendingNotify;
00015 static Http_Source_BaseIncomingSet                      Global_HttpManager;
00016 
00017 bool Http_Request::HttpManager_Initialize( unsigned short port)
00018 {
00019     init_network();
00020     Socket_Address address;
00021     address.set_port(port);
00022     return Global_HttpManager.init(address);
00023 }
00024 
00025 Http_Request * Http_Request::HttpManager_GetARequest()
00026 {
00027     Time_Clock  Know;
00028     Global_HttpManager.PumpAll(Know);
00029     Http_Request * answer = NULL;
00030     std::set< Http_Request * >::iterator ii = Global_WebRequests_pendingNotify.begin();
00031     if(ii != Global_WebRequests_pendingNotify.end())
00032     {   
00033         answer = *ii;
00034         Global_WebRequests_pendingNotify.erase(ii);   
00035     }
00036     return   answer;
00037 }
00038 
 All Classes Functions Variables Enumerations