본문 바로가기

□컴퓨터 관련/☆C, C++

GetLastError() Return Value [펌]


GetLastError()는 말그대로 최종에러값을 검사하는 겁니다.

CAsyncSocket Sock;
.
.
int nErr = Sock.Send(....);
if (nErr == SOCKET_ERROR)
{
    int nCode = Sock.GetLastError();
}

식으로 에러값(nCode)을 검사하는 거죠. 에러값에 알맞은 처리를 해야하니까요.

에러코드는 나 에 정의되어 있습니다.

밑에 아는 것만 적어드리죠..

정신없게 써있죠?? ^^; 클립보드에 복사해서 메모장 같은 에디터에 넣고 보세요.

그나마 정렬하느라 땀뺀겁니다. ^^; 즐거운 하루 되세요. ^-^=

============================================================================================
Defined                 Code  Description
============================================================================================
WSAEINTR        10004 WSACancelBlockingCall()에 의해 블록화 호출이 취소: Interrupted system call)

WSAEBADF        10009 표준 C와 동일: Bad file number

WSAEACCES        10013 표준 C와 동일: Permission denied

WSAEFAULT        10014 표준 C와 동일: Bad address

WSAEINVAL        10022 표준 C와 동일: 소켓이 주소에 바인딩되지 않았습니다.(Invalid argument)

WSAEMFILE        10024 표준 C와 동일: Too many open files

WSAEWOULDBLOCK        10035 소켓이 비블록화 모드에 있고 요청된 오퍼레이션이 블록: NonBlocking)이고, 연결이 곧바로 종료될 수 없습니다.(Operation would block)

WSAEINPROGRESS        10036 블록화 함수가 진행되는 동안 부적절한 윈속 API함수가 호출.    WSACancelBlockingCall 함수와 WSAIsBlocking 함수와 같이 일부 윈속 함수는 허용:Operation now in progress)

WSAEALREADY        10037 이미 완료된 비동기 오퍼레이션에 대한 취소가 시도됨: Operation already in progress

WSAENOTSOCK        10038 해당 애플리케이션에 대해 지정된 소켓 기술자가 유효하지 않음: Socket operation on non-socket)

WSAEDESTADDRREQ        10039 해당 함수에 대해 목적지 어드레스가 필요하지만 제공되지 않았음: (Destination address required)

WSAEMSGSIZE        10040 데이터 수신 시 데이터그램이 너무 길어서 제공된 버퍼에 맞지 않아 잘렸음. 데이터 전송 시 제공된 데이터그램이 윈도우즈 소켓 시스템에 의해 제공된 데이터그램의 최대 크기보다 더 김

WSAEPROTOTYPE        10041 지정된 프로토콜이 다른 파라미터와 일치하지 않음: Protocol wrong type for socket

WSAENOPROTOOPT        10042 프로토콜 옵션이 알려지지 않은 것이거나 유효하지 않음: Protocol not available

WSAEPROTONOSUPPORT    10043 지정된 프로토콜이 윈도우즈 소켓 시스템에 의해 지원되지 않음: Protocol not supported

WSAESOCKTNOSUPPORT    10044 지정된 소켓 타입이 지정된 어드레스 패밀리에 의해 지원도지 않음: Socket type not supported

WSAEOPNOTSUPP        10045 소켓이 지정된 어퍼레이션을 지원하지 않음. 예:listen함수가 데이터그램 소켓에서 호출: Operation not supported on socket

WSAEPFNOSUPPORT        10046 BSD와 동일: Protocol family not supported

WSAEAFNOSUPPORT        10047 지정된 어드레스 패밀리가 윈도우즈 소켓 시스템에 의해 지원되지 않거나 표시된 소켓과 사용될 수 없음: Address family not supported by protocol family

WSAEADDRINUSE        10048 지정된 어드레스가 이미 사용 중임: Address already in use)

WSAEADDRNOTAVAIL    10049 지정된 어드레스를 로컬 머신에서 사용할 수 없음: Can't assign requested address)

WSAENETDOWN        10050 네트워크 서브시스템과 문제가 있음: Network is down)

WSAENETUNREACH        10051 네크웍에 접근할 수 없습니다.(Network is unreachable)

WSAENETRESET        10052 연결이 끊어져서 재설정되어야 함: Network dropped connection on reset

WSAECONNABORTED        10053 타임아웃이나 다른 에러 상황으로 인해 연결이 중지되었음: Software caused connection abort(WSAECONNABORTED)

WSAECONNRESET        10054 연결이 원격 호스트에 의해 재설정되었음: Connection reset by peer

WSAENOBUFS        10055 윈도우즈 소켓 시스템이 버퍼 공간으 넘거나, 애플리케이션에 의해 API에게 제공된 공간이 너무 작아서 요청된 정보를 저장할 수 없음 :(No buffer space available)

WSAEISCONN        10056 지정된 소켓이 이미 연결되었음: Socket is already connected)

WSAENOTCONN        10057 지정된 소켓이 연결되지 않았음: Socket is not connected

WSAESHUTDOWN        10058 소켓에게 셧다운이 요청되었음: Can't send after socket shutdown

WSAETOOMANYREFS        10059 BSD와 동일: Too many references: can't splice

WSAETIMEDOUT        10060 연결이 이루어지기 전에 연결 시도가 타임아웃되었음: (Connection timed out)

WSAECONNREFUSED        10061 서버가 강제로 연결시도를 거절합니다.(Connection refused)

WSAELOOP        10062 BSD와 동일: Too many levels of symbolic links

WSAENAMETOOLONG        10063 BSD와 동일: File name too long

WSAEHOSTDOWN        10064 BSD와 동일: Host is down

WSAEHOSTUNREACH        10065 BSD와 동일: No route to host

WSAENOTEMPTY        네트워크 서브시스템이 아직 통신할 준비가 되어 있지 않음 WSAStartup에 의해 반
환: Directory not empty

WSAEPROCLIM        Too many processes

WSAEUSERS        Too many users

WSAEDQUOT        Disc quota exceeded

WSAESTALE        Stale NFS file handle

WSAEREMOTE        Too many levels of remote in path

WSAEDISCON        Disconnect

WSASYSNOTREADY        네트워크 서브시스템이 아직 통신할 준비가 되어 있지 않음 WSAStartup에 의해 반
환: Network sub-system is unusable

WSAVERNOTSUPPORTED    윈도우즈 소켓  DLL이 요청된 윈속 프로토콜 버전을 지원하지 않음. WSAStartUp에 의해 반환: WinSock DLL cannot support this application

WSANOTINITIALISED    WSAStartup함수가 성공적으로 수행되기 전에 모든 윈속 API함수에 의해 반환: WinSock not initialized

WSAHOST_NOT_FOUND    요청된 데이터베이스 정보가 존재하지 않은. 공인 호스트에 의해 확인: Host not found

WSATRY_AGAIN        요청된 정보가 발견되지 않았지만 응답에 대한 공인도가 없음: Non-authoritative host not found

WSANO_RECOVERY        복구할 수 없는 에러가 발생하였음: Non-recoverable error

WSANO_DATA        제공된 이름이 유효하지만 요청된 타입의 정보가 데이터베이스에 없음: Valid name, no data record of requested type

'□컴퓨터 관련 > ☆C, C++' 카테고리의 다른 글

[Batch] 해당 폴더 내 특정 파일 검색하기  (2) 2016.11.17
warning c4996 strcpy deprecated  (0) 2011.02.11
VC++로 DLL만들기  (0) 2011.02.08
#pragma란?  (2) 2010.04.07
데브피아  (3) 2010.02.08
매트랩 기본  (0) 2008.10.07
비트연산  (0) 2008.10.02