Ved ikke om det virker, men du kunne prøve at bruge winsock2. For at få besked om connection attempts kunne du bruge WSAEventSelect (FD_ACCEPT). Har fået idéen fra et program der bruger det til at fange alt incomming data (
http://www.codeguru.com/network/ipmon.html ) :
int WSAEventSelect (
SOCKET s,
WSAEVENT hEventObject,
long lNetworkEvents
);
Parameters
s
[in] A descriptor identifying the socket.
hEventObject
[in] A handle identifying the event object to be associated with the supplied set of FD_XXX network events.
lNetworkEvents
[in] A bitmask that specifies the combination of FD_XXX network events in which the application has interest.
FD_READ Want to receive notification of readiness for reading
FD_WRITE Want to receive notification of readiness for writing
FD_OOB Want to receive notification of the arrival of out-of-band data
FD_ACCEPT Want to receive notification of incoming connections
FD_CONNECT Want to receive notification of completed connection or multipoint \"join\" operation
FD_CLOSE Want to receive notification of socket closure
FD_QOS Want to receive notification of socket Quality of Service (QOS) changes
FD_GROUP_QOS Reserved for future use with socket groups. Want to receive notification of socket group Quality of Service (QOS) changes
FD_ROUTING
_INTERFACE_CHANGE Want to receive notification of routing interface changes for the specified destination
FD_ADDRESS_LIST
_CHANGE Want to receive notification of local address list changes for the address family of the socket