source: libcf/trunk/include/cf_socket.h@ 128

Last change on this file since 128 was 128, checked in by cheese, 11 years ago

#1 add bitwise util from ARIA of chevalier

File size: 1.7 KB
Line 
1/**
2 * \file cf_socket.h
3 *
4 * \author myusgun <myusgun@gmail.com>
5 *
6 * \brief TCP 소켓 지원
7 *
8 * \example socket.c
9 */
10#ifndef __CF_SOCKET_H__
11#define __CF_SOCKET_H__
12
13#include "cf_base.h"
14
15#include <stddef.h>
16
17/** 타임아웃을 설정하지 않음 */
18#define CF_SOCKET_NO_TIMEOUT -1
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24CF_EXPORT CF_BOOL
25CF_Socket_IsInitialized (void);
26
27CF_EXPORT int
28CF_Socket_Initialize (void);
29
30CF_EXPORT int
31CF_Socket_Finalize (void);
32
33CF_EXPORT int
34CF_Socket_Close (const int sock);
35
36CF_EXPORT int
37CF_Socket_SetOption (const int sock,
38 const int optname,
39 const void * optval,
40 const size_t optlen);
41
42CF_EXPORT int
43CF_Socket_GetOption (const int sock,
44 const int optname,
45 void * optval,
46 size_t * optlen);
47
48CF_EXPORT int
49CF_Socket_Connect (const char * ip,
50 const unsigned short port);
51
52CF_EXPORT int
53CF_Socket_ConnectTimeout (const char * ip,
54 const unsigned short port,
55 const int timeout);
56
57CF_EXPORT int
58CF_Socket_Server (const unsigned short port,
59 const int backlog);
60
61CF_EXPORT int
62CF_Socket_Accept (const int sock);
63
64CF_EXPORT int
65CF_Socket_Send (const int sock,
66 const void * buf,
67 const size_t len);
68
69CF_EXPORT int
70CF_Socket_SendTimeout (const int sock,
71 const void * buf,
72 const size_t len,
73 const int timeout);
74
75CF_EXPORT int
76CF_Socket_Recv (const int sock,
77 void * buf,
78 const size_t len);
79
80CF_EXPORT int
81CF_Socket_RecvTimeout (const int sock,
82 void * buf,
83 const size_t len,
84 const int timeout);
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif // #ifndef __CF_SOCKET_H__
Note: See TracBrowser for help on using the repository browser.