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

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

#1 add typical data structure algorithms (linked-list / queue / stak) and rename symbol for context of each modules

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