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