Strange WSAAsyncSelect Issue

Giganews Newsgroups
Subject: Strange WSAAsyncSelect Issue
Posted by:  Jon Robertson (jon.roberts…
Date: Sun, 25 Sep 2011

We are not using Indy directly, but are using DataSnap which is using
Indy for TCP communication between client and server.  I'm hoping
someone here might have some insight on a strange issue we are seeing.

We have a DataSnap client talking to a DataSnap server via TCP/IP.  For
most users, the client can connect to the server without incident.

However, on a given workstation where two Windows profiles can run our
software and connect successfully, a third Windows profile gets the
error "Invalid argument (#10022 in WSAAsyncSelect)" when trying to

Same application, same exact build.  The source code is not doing
anything specific to the Windows profile.  User rights should not be an
issue.  Just to be sure, we made Domain Users an Administrator on one
of the workstations we were testing.  This made no difference.

I've searched and cannot find anywhere that either Indy or
dbExpress/DataSnap is calling WSAAsyncSelect.  And I've been informed
that Indy would never call WSAAsyncSelect because Indy uses blocking

Is it possible that under the hood, blocking WinSock calls call the
async functions?

Has anyone seen something like this before?  Where WSAAsyncSelect will
fail for one user but not another?

Thank you so much for any thoughts you have.

Jon Robertson
Embarcadero Certified Delphi XE Developer
Good programming is 40% experience, 30% skill, 20% RTFM, 10% caffeine,
and 5% attention to detail.