The Windows Sockets
(or What's Weak This Week)
brought to you by the Windows Sockets Vendor Community
(compiled by Keith Moore)
- Calling connect() on a non-blocking socket, getting
WSAEWOULDBLOCK, then immediately calling recv() and expecting
WSAEWOULDBLOCK before the connection has been established.
- Calling select() with three empty FD_SETs and a valid
TIMEOUT structure as a sleezy delay function.
- Polling with connect() on a non-blocking socket to
determine when the connection has been established.
- Assuming socket handles are always less than 16.
in a sweaty mass of lameness.
- Polling with select() and a zero timeout in Win16's
- Calling WSAAsyncSelect() with a zero Event mask just
to make the socket non-blocking.
Lame. Lame. Lame. Lame. Lame.
- Telnet applications that neither enable OOBINLINE, nor read
- Assuming 0 is an invalid socket handle value.
- Applications that don't properly shutdown when the user closes
the main window while a blocking API is in progress.
- Out of band data.
- Calling strlen() on a hostent structure's ip address,
then truncating it to four bytes, thereby overwriting part of
malloc()'s heap header.
In all my years of observing
lameness, I have seldom seen something this lame.
- Polling with recv(MSG_PEEK) to determine when a complete
message has arrived.
Thrashing in a sea of lameness.
- Martin Hall's hairline.
Well, it's not that bad. Really.
Certainly less lame than J. Allard's hairline.
- Bounding every set of operations with calls to WSAStartup()
Pushing the lameness envelope.
- Ignoring API errors.
- Microsoft's Telnet and FTP clients.
- Installing an empty blocking hook that just returns FALSE.
Floundering in an endless desert of lameness.
- Client applications that bind to a specific port.
in self lameness.
- Nagle challenged applications.
Perilously teetering on
the edge of a vast chasm of lameness.
- Assuming stream sockets maintain message frame boundaries.
Mind bogglingly lame.
- 16-bit DLLs that call WSACleanup() from their WEP.
- Single byte send()s and recv()s.
in a pool of lameness.
Self abusively lame.
- Applications that call gethostbyname() before calling
Words fail to express such all consuming
- Win32 applications that install blocking hooks.
- Polling with ioctlsocket( FIONREAD ) on a stream socket
until a complete "message" arrives.
Exceeds the bounds
of earthly lameness.
- Punching inanimate objects.