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
RevLine 
[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
22extern "C" {
23#endif
24
[6]25CF_EXPORT CF_BOOL
[46]26CF_Socket_IsInitialized (void);
[4]27
28CF_EXPORT int
[46]29CF_Socket_Initialize (void);
[4]30
31CF_EXPORT int
[46]32CF_Socket_Finalize (void);
[4]33
34CF_EXPORT int
[46]35CF_Socket_Close (const int sock);
[4]36
37CF_EXPORT int
[46]38CF_Socket_SetOption (const int sock,
39 const int optname,
40 const void * optval,
41 const size_t optlen);
[4]42
43CF_EXPORT int
[46]44CF_Socket_GetOption (const int sock,
45 const int optname,
46 void * optval,
47 size_t * optlen);
[4]48
49CF_EXPORT int
[46]50CF_Socket_Connect (const char * ip,
51 const unsigned short port);
[4]52
53CF_EXPORT int
[46]54CF_Socket_ConnectTimeout (const char * ip,
55 const unsigned short port,
56 const int timeout);
[4]57
58CF_EXPORT int
[46]59CF_Socket_Server (const unsigned short port,
60 const int backlog);
[4]61
62CF_EXPORT int
[53]63CF_Socket_Accept (const int sock);
[4]64
65CF_EXPORT int
[46]66CF_Socket_Send (const int sock,
67 const void * buf,
68 const int len);
[4]69
70CF_EXPORT int
[46]71CF_Socket_SendTimeout (const int sock,
72 const void * buf,
73 const int len,
74 const int timeout);
[4]75
[46]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
[4]87#ifdef __cplusplus
88}
89#endif
90
91#endif // #ifndef __CF_SOCKET_H__
Note: See TracBrowser for help on using the repository browser.