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

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

#1 remove structure for remote host information interface from socket

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