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
|
---|
22 | extern "C" {
|
---|
23 | #endif
|
---|
24 |
|
---|
25 | CF_EXPORT CF_BOOL
|
---|
26 | CF_Socket_IsInitialized (void);
|
---|
27 |
|
---|
28 | CF_EXPORT int
|
---|
29 | CF_Socket_Initialize (void);
|
---|
30 |
|
---|
31 | CF_EXPORT int
|
---|
32 | CF_Socket_Finalize (void);
|
---|
33 |
|
---|
34 | CF_EXPORT int
|
---|
35 | CF_Socket_Close (const int sock);
|
---|
36 |
|
---|
37 | CF_EXPORT int
|
---|
38 | CF_Socket_SetOption (const int sock,
|
---|
39 | const int optname,
|
---|
40 | const void * optval,
|
---|
41 | const size_t optlen);
|
---|
42 |
|
---|
43 | CF_EXPORT int
|
---|
44 | CF_Socket_GetOption (const int sock,
|
---|
45 | const int optname,
|
---|
46 | void * optval,
|
---|
47 | size_t * optlen);
|
---|
48 |
|
---|
49 | CF_EXPORT int
|
---|
50 | CF_Socket_Connect (const char * ip,
|
---|
51 | const unsigned short port);
|
---|
52 |
|
---|
53 | CF_EXPORT int
|
---|
54 | CF_Socket_ConnectTimeout (const char * ip,
|
---|
55 | const unsigned short port,
|
---|
56 | const int timeout);
|
---|
57 |
|
---|
58 | CF_EXPORT int
|
---|
59 | CF_Socket_Server (const unsigned short port,
|
---|
60 | const int backlog);
|
---|
61 |
|
---|
62 | CF_EXPORT int
|
---|
63 | CF_Socket_Accept (const int sock);
|
---|
64 |
|
---|
65 | CF_EXPORT int
|
---|
66 | CF_Socket_Send (const int sock,
|
---|
67 | const void * buf,
|
---|
68 | const int len);
|
---|
69 |
|
---|
70 | CF_EXPORT int
|
---|
71 | CF_Socket_SendTimeout (const int sock,
|
---|
72 | const void * buf,
|
---|
73 | const int len,
|
---|
74 | const int timeout);
|
---|
75 |
|
---|
76 | CF_EXPORT int
|
---|
77 | CF_Socket_Recv (const int sock,
|
---|
78 | void * buf,
|
---|
79 | const int len);
|
---|
80 |
|
---|
81 | CF_EXPORT int
|
---|
82 | CF_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.