Mercurial
comparison seobeo/seobeo.h @ 17:d97ec3ded2ae
[Seobeo] Few changes...
- Fixed seobeo edge for macos
- Updated so that socket creation can be used for both client and server
- Started on a cutelient library for making connection to the server.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Sat, 04 Oct 2025 07:53:12 -0700 |
| parents | fb2cff495a60 |
| children | fa2b8af609d9 |
comparison
equal
deleted
inserted
replaced
| 16:fb2cff495a60 | 17:d97ec3ded2ae |
|---|---|
| 68 SEOBEO_MODE_FORK, | 68 SEOBEO_MODE_FORK, |
| 69 SEOBEO_MODE_EDGE, | 69 SEOBEO_MODE_EDGE, |
| 70 } Seobeo_ServerMode; | 70 } Seobeo_ServerMode; |
| 71 | 71 |
| 72 // --- Socket, IP related --- // | 72 // --- Socket, IP related --- // |
| 73 extern int Seobeo_CreateSocket(int32 stream, const char *host, const char* port, int32 backlog); | 73 extern int Seobeo_CreateSocket(int32 stream, const char *host, const char* port); |
| 74 extern void *Seobeo_GetIP4OrIP6(struct sockaddr *sa); | 74 extern void *Seobeo_GetIP4OrIP6(struct sockaddr *sa); |
| 75 | 75 |
| 76 // --- TCP --- // | 76 // --- TCP --- // |
| 77 extern Seobeo_PHandle Seobeo_Stream_Handle_Create(const char *host, const char* port); | 77 extern Seobeo_PHandle Seobeo_Stream_Handle_Create(const char *host, const char* port); |
| 78 extern Seobeo_PHandle Seobeo_Stream_Handle_Accept(Seobeo_PHandle p_server_handle); | 78 extern Seobeo_PHandle Seobeo_Stream_Handle_Accept(Seobeo_PHandle p_server_handle); |
| 83 extern void Seobeo_Web_HandleClientRequest(Seobeo_PHandle cli, Dowa_PHashMap p_html_cache); | 83 extern void Seobeo_Web_HandleClientRequest(Seobeo_PHandle cli, Dowa_PHashMap p_html_cache); |
| 84 extern int Seobeo_Web_ParseClientHeader(Seobeo_PHandle p_handle, Dowa_PHashMap map); | 84 extern int Seobeo_Web_ParseClientHeader(Seobeo_PHandle p_handle, Dowa_PHashMap map); |
| 85 extern int Seobeo_Web_StartBasicHTTPServer(const char *folder_path, const char *port, Seobeo_ServerMode mode, int thread_count); | 85 extern int Seobeo_Web_StartBasicHTTPServer(const char *folder_path, const char *port, Seobeo_ServerMode mode, int thread_count); |
| 86 extern void *Seobeo_Web_Edge_Worker(void *vargs); // Maybe not web only... | 86 extern void *Seobeo_Web_Edge_Worker(void *vargs); // Maybe not web only... |
| 87 extern void Seobeo_Web_Edge(Seobeo_PHandle p_server_handle, int thread_count, Dowa_PHashMap p_html_cache); | 87 extern void Seobeo_Web_Edge(Seobeo_PHandle p_server_handle, int thread_count, Dowa_PHashMap p_html_cache); |
| 88 extern int Seobeo_Web_ClientGet(const char *host, const char *port, const char *path); | |
| 89 | |
| 88 | 90 |
| 89 // --- Helper functions --- // | 91 // --- Helper functions --- // |
| 90 extern void Seobeo_Handle_Destroy(Seobeo_PHandle p_handle); | 92 extern void Seobeo_Handle_Destroy(Seobeo_PHandle p_handle); |
| 91 extern int Seobeo_Handle_Flush(Seobeo_PHandle p_handle); | 93 extern int Seobeo_Handle_Flush(Seobeo_PHandle p_handle); |
| 92 extern int Seobeo_Handle_Queue(Seobeo_PHandle p_handle, const uint8_t *data, uint32_t data_size); | 94 extern int Seobeo_Handle_Queue(Seobeo_PHandle p_handle, const uint8_t *data, uint32_t data_size); |