Changeset 151 in libcf for trunk/include/cf_socket.h


Ignore:
Timestamp:
10/31/13 10:17:24 (11 years ago)
Author:
cheese
Message:

#1 fix interface and add util module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/cf_socket.h

    r128 r151  
    1616
    1717/** 타임아웃을 설정하지 않음 */
    18 #define CF_SOCKET_NO_TIMEOUT        -1
     18#define CF_SOCKET_NO_TIMEOUT        0
    1919
    2020#ifdef __cplusplus
    2121extern "C" {
    2222#endif
    23 
    24 CF_EXPORT CF_BOOL
    25 CF_Socket_IsInitialized     (void);
    2623
    2724CF_EXPORT int
     
    3229
    3330CF_EXPORT int
    34 CF_Socket_Close             (const int sock);
     31CF_Socket_Create            (cf_ctx * ctx);
    3532
    3633CF_EXPORT int
    37 CF_Socket_SetOption         (const int      sock,
     34CF_Socket_Close             (cf_ctx ctx);
     35
     36CF_EXPORT int
     37CF_Socket_Connect           (cf_ctx                 ctx,
     38                             const char             * ip,
     39                             const unsigned short   port);
     40
     41CF_EXPORT int
     42CF_Socket_Server            (cf_ctx                 ctx,
     43                             const unsigned short   port,
     44                             const int              backlog);
     45
     46CF_EXPORT int
     47CF_Socket_Accept            (const cf_ctx   ctx,
     48                             cf_ctx         * client);
     49
     50CF_EXPORT int
     51CF_Socket_Send              (const cf_ctx   ctx,
     52                             const void     * buf,
     53                             const size_t   len);
     54
     55CF_EXPORT int
     56CF_Socket_Recv              (const cf_ctx   ctx,
     57                             void           * buf,
     58                             const size_t   len);
     59
     60CF_EXPORT int
     61CF_Socket_SetOption         (const cf_ctx   ctx,
    3862                             const int      optname,
    3963                             const void     * optval,
     
    4165
    4266CF_EXPORT int
    43 CF_Socket_GetOption         (const int  sock,
    44                              const int  optname,
    45                              void       * optval,
    46                              size_t     * optlen);
     67CF_Socket_GetOption         (const cf_ctx   ctx,
     68                             const int      optname,
     69                             void           * optval,
     70                             size_t         * optlen);
    4771
    4872CF_EXPORT int
    49 CF_Socket_Connect           (const char             * ip,
    50                              const unsigned short   port);
     73CF_Socket_SetTimeOut        (cf_ctx ctx,
     74                             int    timeout);
    5175
    5276CF_EXPORT int
    53 CF_Socket_ConnectTimeout    (const char             * ip,
    54                              const unsigned short   port,
    55                              const int              timeout);
     77CF_Socket_GetIP             (const cf_ctx   ctx,
     78                             char           * ip);
    5679
    5780CF_EXPORT int
    58 CF_Socket_Server            (const unsigned short   port,
    59                              const int              backlog);
    60 
    61 CF_EXPORT int
    62 CF_Socket_Accept            (const int sock);
    63 
    64 CF_EXPORT int
    65 CF_Socket_Send              (const int      sock,
    66                              const void     * buf,
    67                              const size_t   len);
    68 
    69 CF_EXPORT int
    70 CF_Socket_SendTimeout       (const int      sock,
    71                              const void     * buf,
    72                              const size_t   len,
    73                              const int      timeout);
    74 
    75 CF_EXPORT int
    76 CF_Socket_Recv              (const int      sock,
    77                              void           * buf,
    78                              const size_t   len);
    79 
    80 CF_EXPORT int
    81 CF_Socket_RecvTimeout       (const int      sock,
    82                              void           * buf,
    83                              const size_t   len,
    84                              const int      timeout);
     81CF_Socket_GetPort           (const cf_ctx   ctx,
     82                             unsigned short * port);
    8583
    8684#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.