/** * \file cf_socket.h * * \author myusgun * * \brief TCP 소켓 지원 * * \example socket.c */ #ifndef __CF_SOCKET_H__ #define __CF_SOCKET_H__ #include "cf_base.h" #include /** 타임아웃을 설정하지 않음 */ #define CF_SOCKET_NO_TIMEOUT -1 #ifdef __cplusplus extern "C" { #endif CF_EXPORT CF_BOOL CF_Socket_IsInitialized (void); CF_EXPORT int CF_Socket_Initialize (void); CF_EXPORT int CF_Socket_Finalize (void); CF_EXPORT int CF_Socket_Close (const int sock); CF_EXPORT int CF_Socket_SetOption (const int sock, const int optname, const void * optval, const size_t optlen); CF_EXPORT int CF_Socket_GetOption (const int sock, const int optname, void * optval, size_t * optlen); CF_EXPORT int CF_Socket_Connect (const char * ip, const unsigned short port); CF_EXPORT int CF_Socket_ConnectTimeout (const char * ip, const unsigned short port, const int timeout); CF_EXPORT int CF_Socket_Server (const unsigned short port, const int backlog); CF_EXPORT int CF_Socket_Accept (const int sock); CF_EXPORT int CF_Socket_Send (const int sock, const void * buf, const size_t len); CF_EXPORT int CF_Socket_SendTimeout (const int sock, const void * buf, const size_t len, const int timeout); CF_EXPORT int CF_Socket_Recv (const int sock, void * buf, const size_t len); CF_EXPORT int CF_Socket_RecvTimeout (const int sock, void * buf, const size_t len, const int timeout); #ifdef __cplusplus } #endif #endif // #ifndef __CF_SOCKET_H__