//\r
\r
#define DBG_LEVEL 0\r
-#include <Raym/Log.h>\r
-#include <Raym/Raym.h>\r
+#include "Raym/Log.h"\r
+#include "Raym/Raym.h"\r
#include "net/HTTPDaemon.h"\r
\r
using namespace Raym;\r
{\r
header->setFieldBodyWithName("application/x-mpegURL", "Content-Type");\r
}\r
+ else if (ext->isEqualToString("ts"))\r
+ {\r
+ header->setFieldBodyWithName("video/mp2t", "Content-Type");\r
+ }\r
else\r
{\r
header->setFieldBodyWithName("application/octet-stream", "Content-Type");\r
}\r
else\r
{\r
- DebugLog3("reauest is null");\r
+ DebugLog3("request is null");\r
done = true;\r
}\r
\r
// セッションの終了待ち\r
if (_sockets->count() > 0)\r
{\r
+ DebugLog2("wait for session close 00");\r
// 残存セッションを終了させる為、ソケットを閉じる\r
for (uint i = 0; i < _sockets->count(); ++i)\r
{\r
SOCKET s = (SOCKET)((Number *)_sockets->objectAtIndex(i))->intValue();\r
closesocket(s);\r
}\r
+ DebugLog2("wait for session close 01");\r
// セッションが終了して_socketからオブジェクトを削除するのを待つ\r
while (_sockets->count() > 0)\r
{\r
LeaveCriticalSection(&_cs);\r
- Sleep(20);\r
+ ::Sleep(200);\r
EnterCriticalSection(&_cs);\r
}\r
+ DebugLog2("wait for session close 02");\r
}\r
\r
DebugLog2("HTTPDaemon::run() session close done.");\r
\r
void HTTPDaemon::stop()\r
{\r
- DebugLog2("HTTPDaemon::stop()", __FUNCTION__);\r
+ DebugLog2("HTTPDaemon::stop()");\r
\r
EnterCriticalSection(&_cs);\r
if (_state == ST_RUN)\r
LeaveCriticalSection(&_cs);\r
\r
wait();\r
+\r
+ DebugLog2("HTTPDaemon::stop() done.");\r
}\r
\r
void HTTPDaemon::wait()\r
{\r
+ DebugLog2("HTTPDaemon::wait()");\r
bool done = false;\r
while (!done)\r
{\r
::Sleep(100);\r
}\r
}\r
+ DebugLog2("HTTPDaemon::wait() done.");\r
}\r
\r
const char *HTTPDaemon::className()\r