Panda3D
 All Classes Functions Variables Enumerations
http_request.cxx
1 #include "socket_base.h"
2 
3 
4 #include "http_connection.h"
5 #include "baseincomingset.h"
6 #include "socket_base.h"
7 
8 
9 #include "http_request.h"
10 
11 TypeHandle Http_Request::_type_handle;
12 
14 std::set< Http_Request * > Global_WebRequests_pendingNotify;
15 static Http_Source_BaseIncomingSet Global_HttpManager;
16 
17 bool Http_Request::HttpManager_Initialize( unsigned short port)
18 {
19  init_network();
20  Socket_Address address;
21  address.set_port(port);
22  return Global_HttpManager.init(address);
23 }
24 
25 Http_Request * Http_Request::HttpManager_GetARequest()
26 {
27  Time_Clock Know;
28  Global_HttpManager.PumpAll(Know);
29  Http_Request * answer = NULL;
30  std::set< Http_Request * >::iterator ii = Global_WebRequests_pendingNotify.begin();
31  if(ii != Global_WebRequests_pendingNotify.end())
32  {
33  answer = *ii;
34  Global_WebRequests_pendingNotify.erase(ii);
35  }
36  return answer;
37 }
38 
A simple place to store and munipulate tcp and port address for communication layer.
A base structre for a listening socket and a set of connection that have been received with there rea...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
bool set_port(int port)
Set to a specified port.