Changeset 53 in libcf
- Timestamp:
- 04/03/13 17:13:09 (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/cf_socket.h
r46 r53 18 18 /** 타임아웃을 설정하지 않음 */ 19 19 #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;26 20 27 21 #ifdef __cplusplus … … 67 61 68 62 CF_EXPORT int 69 CF_Socket_Accept (const int sock, 70 CF_Socket_HostInfo * host); 63 CF_Socket_Accept (const int sock); 71 64 72 65 CF_EXPORT int -
trunk/src/cf_debug.c
r52 r53 38 38 typedef void * CF_Debug_Ctx; 39 39 40 /* *40 /* * 41 41 * 콜스택 데이터 42 42 * … … 44 44 */ 45 45 typedef 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; /* *< 라인 넘버 */ 49 49 } CF_Debug_CallStack; 50 50 … … 412 412 return CF_ERROR_DEBUG_INVALID_CTX; 413 413 414 for (callstack = ctx->callstack.caller ; callstack ; callstack = callstack->caller) 414 for ( callstack = ctx->callstack.caller 415 ; callstack 416 ; callstack = callstack->caller) 415 417 { 416 418 fprintf (fp, "#%-4d %s <%s:%d>\n", -
trunk/src/cf_socket.c
r50 r53 482 482 * 483 483 * @param sock 서버 소켓 484 * @param host [옵션] 클라이언트 정보를 담을 CF_Socket_HostInfo 구조체 포인터485 484 * 486 485 * @see CF_Socket_HostInfo 487 486 */ 488 487 int 489 CF_Socket_Accept (const int sock, 490 CF_Socket_HostInfo * host) 488 CF_Socket_Accept (const int sock) 491 489 { 492 490 int sockClient = 0; … … 499 497 if (sockClient < 0) 500 498 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 }509 499 510 500 return sockClient; -
trunk/test/socket_server.c
r46 r53 22 22 } 23 23 24 clntsock = CF_Socket_Accept (srvsock , NULL);24 clntsock = CF_Socket_Accept (srvsock); 25 25 if (clntsock < 0) { 26 26 fprintf (stderr, "error : accept (%d)\n", clntsock);
Note:
See TracChangeset
for help on using the changeset viewer.