10 #ifndef CMNCLIB_CMN_NET_H_
11 #define CMNCLIB_CMN_NET_H_
17 #if IS_PRATFORM_WINDOWS()
20 #include <sys/types.h>
21 #include <sys/socket.h>
22 #include <netinet/in.h>
26 #define CNS_OPT_GRACEFUL_CLOSE 0x01
45 #if IS_PRATFORM_WINDOWS()
CmnNetSocketStatus errorStatus
Definition: CmnNet.h:57
D_EXTERN CmnNetSocketStatus CmnNetSocket_ReceiveAll(CmnNetSocket *socket, CmnDataBuffer *buf, const char *endMark, const int endMarkLen)
ソケットからすべてのデータを読み込む
Definition: CmnNetSocket.c:377
void(* serverMainProc)(CmnNetSocket *)
Definition: CmnNet.h:56
D_EXTERN CmnNetHttpResponse * CmnNetHttp_GetRequest(const char *ip, unsigned short port, const char *path)
HTTPのGETリクエストを送信する
Definition: CmnNetHttp.c:17
D_EXTERN CmnNetSocketStatus CmnNetSocket_NoSessionRequest(const char *host, unsigned short port, CmnDataBuffer *request, CmnDataBuffer *response, const char *responseEndMark, const int responseEndMarkLen, int opt)
セッションレスTCP/IPリクエスト送信
Definition: CmnNetSocket.c:295
struct tag_CmnNetSocketServer CmnNetSocketServer
Definition: CmnThread.h:33
D_EXTERN CmnNetHttpResponse * CmnNetHttp_PostRequest(const char *ip, unsigned short port, const char *path, CmnDataBuffer *requestBody)
HTTPのPOSTリクエストを送信する
Definition: CmnNetHttp.c:34
D_EXTERN CmnNetSocketStatus CmnNetSocket_EndServer(CmnNetSocketServer *server)
サーバーを終了する
Definition: CmnNetSocket.c:273
struct tag_CmnNetSocket CmnNetSocket
D_EXTERN CmnNetSocketStatus CmnNetSocket_StartServer(unsigned short port, void(*serverMainProc)(CmnNetSocket *), CmnNetSocketServer *server)
TCP/IP待ち受けサーバー起動
Definition: CmnNetSocket.c:190
CmnThread * acceptThread
Definition: CmnNet.h:55
D_EXTERN CmnNetSocketStatus CmnNetSocket_SendAll(CmnNetSocket *socket, const void *data, int len)
ソケットへすべてのデータを書き込む
Definition: CmnNetSocket.c:419
CmnNetSocketStatus
Definition: CmnNet.h:29
int socketId
Definition: CmnNet.h:48
volatile int _isRunnable
Definition: CmnNet.h:58
D_EXTERN CmnNetSocketStatus CmnNetSocket_ToSocketAddress(const char *host, unsigned short port, struct sockaddr_in *addr)
IPアドレスやホスト名文字列とポート番号からsockaddr_inを設定する
Definition: CmnNetSocket.c:439
CmnNetSocket * serverSocket
Definition: CmnNet.h:54