22 #ifndef BACKENDS_NETWORKING_SDL_NET_LOCALWEBSERVER_H 23 #define BACKENDS_NETWORKING_SDL_NET_LOCALWEBSERVER_H 25 #include "backends/networking/sdl_net/client.h" 26 #include "backends/networking/sdl_net/handlers/basehandler.h" 27 #include "backends/networking/sdl_net/handlers/createdirectoryhandler.h" 28 #include "backends/networking/sdl_net/handlers/downloadfilehandler.h" 29 #include "backends/networking/sdl_net/handlers/filesajaxpagehandler.h" 30 #include "backends/networking/sdl_net/handlers/filespagehandler.h" 31 #include "backends/networking/sdl_net/handlers/indexpagehandler.h" 32 #include "backends/networking/sdl_net/handlers/listajaxhandler.h" 33 #include "backends/networking/sdl_net/handlers/resourcehandler.h" 34 #include "backends/networking/sdl_net/handlers/uploadfilehandler.h" 35 #include "common/hash-str.h" 36 #include "common/mutex.h" 37 #include "common/singleton.h" 38 #include "common/scummsys.h" 42 #include "backends/networking/sdl_net/handlers/connectcloudhandler.h" 47 class SeekableReadStream;
50 typedef struct _SDLNet_SocketSet *SDLNet_SocketSet;
51 typedef struct _TCPsocket *TCPsocket;
55 #define NETWORKING_LOCALWEBSERVER_ENABLE_PORT_OVERRIDE 58 static const uint32 FRAMES_PER_SECOND = 20;
59 static const uint32 TIMER_INTERVAL = 1000000 / FRAMES_PER_SECOND;
60 static const uint32 MAX_CONNECTIONS = 10;
62 friend void localWebserverTimer(
void *);
64 SDLNet_SocketSet _set;
65 TCPsocket _serverSocket;
66 Client _client[MAX_CONNECTIONS];
68 bool _timerStarted, _stopOnIdle, _minimalMode;
89 void startTimer(
int interval = TIMER_INTERVAL);
92 void handleClient(uint32 i);
94 void resolveAddress(
void *ipAddress);
98 static const uint32 DEFAULT_SERVER_PORT = 12345;
103 void start(
bool useMinimalMode =
false);
110 static uint32 getPort();
114 void setStorageConnectionCallback(
Networking::ErrorCallback cb) { _connectCloudHandler.setStorageConnectionCallback(cb); }
115 #endif // USE_LIBCURL 118 static void setClientGetHandler(
Client &client,
const Common::String &response,
long code = 200,
const char *mimeType =
nullptr);
127 #define LocalServer Networking::LocalWebserver::instance() Definition: connectcloudhandler.h:32
Definition: resourcehandler.h:29
Definition: localwebserver.h:57
Definition: createdirectoryhandler.h:29
Definition: scummvmcloud.h:31
Definition: uploadfilehandler.h:29
Definition: basehandler.h:29
Definition: downloadfilehandler.h:29
Definition: filesajaxpagehandler.h:29
Definition: algorithm.h:29
Definition: filespagehandler.h:29
Definition: callback.h:49
Definition: listajaxhandler.h:30
Definition: indexpagehandler.h:31
Definition: singleton.h:42