Jak cię złapią, to znaczy, że oszukiwałeś. Jak nie, to znaczy, że posłużyłeś się odpowiednią taktyką.
WSAEDESTADDRREQ A destination address is required. WSAEFAULT The namelen argument is incorrect. WSAEINVAL The socket is already bound to an address. WSAEISCONN The socket is already connected. WSAEMFILE No more file descriptors are available. WSAENETUNREACH The network can't be reached from this host at this time. WSAENOBUFS No buffer space is available. The socket cannot be connected. WSAENOTCONN The socket is not connected. WSAENOTSOCK The descriptor is a file, not a socket. WSAETIMEDOUT Attempt to connect timed out without establishing a connection Event: FD_CLOSE Error Code Meaning WSAENETDOWN The Windows Sockets implementation has detected that the network subsystem has failed. WSAECONNRESET The connection was reset by the remote side. WSAECONNABORTED The connection was aborted due to timeout or other failure. Event: FD_READ Event: FD_WRITE Event: FD_OOB Event: FD_ACCEPT Error Code Meaning WSAENETDOWN The Windows Sockets implementation has detected that the network subsystem has failed. Notes For Windows Sockets Suppliers It is the responsibility of the Windows Sockets Supplier to ensure that messages are successfully posted to the application. If a PostMessage() operation fails, the WSAAsyncSelect 109 Windows Sockets implementation MUST re-post that message as long as the window exists. Windows Sockets suppliers should use the WSAMAKESELECTREPLY macro when constructing the lParam in the message. When a socket is closed, the Windows Sockets Supplier should purge any messages remaining for posting to the application window. However the application must be prepared to receive, and discard, any messages which may have been posted prior to the closesocket(). See Also select() 110 WSACancelAsyncRequest 4.3.8 WSACancelAsyncRequest() Description Cancel an incomplete asynchronous operation. #include int PASCAL FAR WSACancelAsyncRequest ( HANDLE hAsyncTaskHandle ); hAsyncTaskHandle Specifies the asynchronous operation to be canceled. Remarks The WSACancelAsyncRequest() function is used to cancel an asynchronous operation which was initiated by one of the WSAAsyncGetXByY() functions such as WSAAsyncGetHostByName(). The operation to be canceled is identified by the hAsyncTaskHandle parameter, which should be set to the asynchronous task handle as returned by the initiating function. Return Value The value returned by WSACancelAsyncRequest() is 0 if the operation was successfully canceled. Otherwise the value SOCKET_ERROR is returned, and a specific error number may be retrieved by calling WSAGetLastError(). Comments An attempt to cancel an existing asynchronous WSAAsyncGetXByY() operation can fail with an error code of WSAEALREADY for two reasons. First, the original operation has already completed and the application has dealt with the resultant message. Second, the original operation has already completed but the resultant message is still waiting in the application window queue. Notes For Windows Sockets Suppliers It is unclear whether the application can usefully distinguish between WSAEINVAL and WSAEALREADY, since in both cases the error indicates that there is no asynchronous operation in progress with the indicated handle. [Trivial exception: 0 is always an invalid asynchronous task handle.] The Windows Sockets specification does not prescribe how a conformant Windows Sockets implementation should distinguish between the two cases. For maximum portability, a Windows Sockets application should treat the two errors as equivalent. Error Codes WSANOTINITIALISED A successful WSAStartup() must occur before using this API. WSAENETDOWN The Windows Sockets implementation has detected that the network subsystem has failed. WSAEINVAL Indicates that the specified asynchronous task handle was invalid WSACancelAsyncRequest 111 WSAEINPROGRESS A blocking Windows Sockets operation is in progress. WSAEALREADY The asynchronous routine being canceled has already completed. See Also WSAAsyncGetHostByAddr(), WSAAsyncGetHostByName(), WSAAsyncGetProtoByNumber(), WSAAsyncGetProtoByName(), WSAAsyncGetHostByName(), WSAAsyncGetServByPort(), WSAAsyncGetServByName(). 112 WSACancelBlockingCall 4.3.9 WSACancelBlockingCall() Description Cancel a blocking call which is currently in progress. #include int PASCAL FAR WSACancelBlockingCall ( void ); Remarks This function cancels any outstanding blocking operation for this task. It is normally used in two situations: (1) An application is processing a message which has been received while a blocking call is in progress. In this case, WSAIsBlocking() will be true. (2) A blocking call is in progress, and Windows Sockets has called back to the application's "blocking hook" function (as established by WSASetBlockingHook()). In each case, the original blocking call will terminate as soon as possible with the error WSAEINTR. (In (1), the termination will not take place until Windows message scheduling has caused control to revert to the blocking routine in Windows Sockets. In (2), the blocking call will be terminated as soon as the blocking hook function completes.) In the case of a blocking connect() operation, the Windows
|
Wątki
|