Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.0 KiB

  1. #include <winsock2.h>
  2. #include "ssdpparser.h"
  3. #include "ssdpfunc.h"
  4. #define EVENT_PORT 5000
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. #define OPEN_TCP_CONN_SIGNATURE 0x1972
  9. #define MAX_EVENT_BUF_THROTTLE_SIZE 200000
  10. #define MAX_EVENT_NOTIFY_HEADER_THROTTLE_SIZE 8192
  11. typedef enum _CONNECTION_STATE
  12. {
  13. CONNECTION_INIT,
  14. CONNECTION_HEADERS_READY,
  15. CONNECTION_ERROR_CLOSING,
  16. CONNECTION_ERROR_FORCED_CLOSE
  17. } CONNECTION_STATE;
  18. typedef struct _OPEN_TCP_CONN {
  19. LIST_ENTRY linkage;
  20. INT iType;
  21. SOCKET socketPeer;
  22. CONNECTION_STATE state;
  23. SSDP_REQUEST ssdpRequest;
  24. CHAR *szData;
  25. DWORD cbData;
  26. DWORD cbHeaders;
  27. } OPEN_TCP_CONN, *POPEN_TCP_CONN;
  28. SOCKET CreateHttpSocket();
  29. BOOL StartHttpServer(SOCKET HttpSocket, HWND hWnd, u_int wMsg);
  30. VOID InitializeListOpenConn();
  31. VOID CleanupListOpenConn();
  32. VOID HandleAccept(SOCKET socket);
  33. VOID CleanupHttpSocket();
  34. DWORD WINAPI LookupListOpenConn(LPVOID pvData);
  35. VOID RemoveOpenConn(SOCKET socket);
  36. #ifdef __cplusplus
  37. }
  38. #endif