Changeset 53 in libcf


Ignore:
Timestamp:
04/03/13 17:13:09 (11 years ago)
Author:
cheese
Message:

#1 remove structure for remote host information interface from socket

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/cf_socket.h

    r46 r53  
    1818/** 타임아웃을 설정하지 않음 */
    1919#define CF_SOCKET_NO_TIMEOUT        -1
    20 
    21 /** 호스트 정보 */
    22 typedef struct cf_socket_hostinfo {
    23     char            address[128];   /**< 원격 호스트 주소 */
    24     unsigned short  port;           /**< 원격 호스트 포트 */
    25 } CF_Socket_HostInfo;
    2620
    2721#ifdef __cplusplus
     
    6761
    6862CF_EXPORT int
    69 CF_Socket_Accept            (const int          sock,
    70                              CF_Socket_HostInfo * host);
     63CF_Socket_Accept            (const int sock);
    7164
    7265CF_EXPORT int
  • trunk/src/cf_debug.c

    r52 r53  
    3838typedef void *  CF_Debug_Ctx;
    3939
    40 /**
     40/* *
    4141 * 콜스택 데이터
    4242 *
     
    4444 */
    4545typedef struct cf_debug_callStack {
    46     char    file[NAME_LENGTH + 1];      /**< 파일 이름 */
    47     char    function[NAME_LENGTH + 1];  /**< 함수 이름 */
    48     int     line;                       /**< 라인 넘버 */
     46    char    file[NAME_LENGTH + 1];      /* *< 파일 이름 */
     47    char    function[NAME_LENGTH + 1];  /* *< 함수 이름 */
     48    int     line;                       /* *< 라인 넘버 */
    4949} CF_Debug_CallStack;
    5050
     
    412412        return CF_ERROR_DEBUG_INVALID_CTX;
    413413
    414     for (callstack = ctx->callstack.caller ; callstack ; callstack = callstack->caller)
     414    for ( callstack = ctx->callstack.caller
     415        ; callstack
     416        ; callstack = callstack->caller)
    415417    {
    416418        fprintf (fp, "#%-4d %s <%s:%d>\n",
  • trunk/src/cf_socket.c

    r50 r53  
    482482 *
    483483 * @param sock  서버 소켓
    484  * @param host  [옵션] 클라이언트 정보를 담을 CF_Socket_HostInfo 구조체 포인터
    485484 *
    486485 * @see CF_Socket_HostInfo
    487486 */
    488487int
    489 CF_Socket_Accept (const int             sock,
    490                   CF_Socket_HostInfo    * host)
     488CF_Socket_Accept (const int sock)
    491489{
    492490    int                 sockClient = 0;
     
    499497    if (sockClient < 0)
    500498        return CF_ERROR_SOCKET_ACCEPT;
    501 
    502     if (host != NULL)
    503     {
    504         snprintf (host->address, sizeof (host->address) - 1,
    505                   "%s",
    506                   inet_ntoa (address.sin_addr));
    507         host->port = ntohs (address.sin_port);
    508     }
    509499
    510500    return sockClient;
  • trunk/test/socket_server.c

    r46 r53  
    2222    }
    2323
    24     clntsock = CF_Socket_Accept (srvsock, NULL);
     24    clntsock = CF_Socket_Accept (srvsock);
    2525    if (clntsock < 0) {
    2626        fprintf (stderr, "error : accept (%d)\n", clntsock);
Note: See TracChangeset for help on using the changeset viewer.