Any TCP/IP library will work. Indy, ICS, Synapse, they all will work just fine with C++Builder. Since Indy ships with C++Builder, you could start with that, but you are certainly not limited to it.
They all use WinSock internally on Windows, so you could just program to the WinSock API directly and not use any libraries at all. All you would need to do is call WSAStartup()
once at program startup, then call socket()
and connect()
for each port you want to check. To check multiple ports, you can either put the sockets into non-blocking mode with ioctlsocket()
and then use either select()
, WSAAsyncSelect()
, WSAAsyncEvent()
, or CreateIoCompletionPort()
/GetQueuedCompletionStatus()
to detect whether connect()
succeeds/fails, or you can put the sockets into blocking mode (their default mode) and use worker threads to call connect()
and let it tell you directly if it succeeds/fails.