Winsock Error Codes - Brought to you by Winsock-Error.com

10009 "File handle is not valid."

WSAEBADF (Winsock error number: 10009)

Microsoft say this about Winsock error 10009 - WSAEBADF:

The file handle supplied is not valid.

Full details of Winsock TCP error 10009 - WSAEBADF:

Berkeley description: A file descriptor argument was out of range, referred to no open file, or a read (write) request was made to a file that was only open for writing (reading).

Microsoft C description: Bad file number. The specified file handle is not a valid file-handle value or does not refer to an open file; or an attempt was made to write to a file or device opened for read-only access (or vice versa).

WinSock description: No equivalent in WinSock. However, because a BSD socket is equivalent to a file handle, some Windows Sockets platforms provide some file handle and socket equivalency. In this case, the WSAEBADF error might mean the same as a WSAENOTSOCK error.

   
This page is designed to help you to understand Winsock TCP error 10009. It will not necessarily mean you can instantly fix issues when your computer tells you that Winsock is having problems with code 10009, rather it will give you the necessary background information to help solve the matter.

Programming declarations for 10009 (WSAEBADF):

C#
long WSAEBADF = 10009 ;

VB.net
Dim WSAEBADF As Long = 10009

VB6
Dim WSAEBADF As Long
WSAEBADF = 10009