Packet Sniffer SDK DLL Edition

HNAdapter :: Properties :: AdpGetThreadCount

 Previous Next

Returns the number of threads created for work with the network adapter.

Syntax:

DWORD __stdcall AdpGetThreadCount(HANDLE hAdp);

Parameters:

hAdp

[in] HNAdapter object handle.

Return values:

If the function succeeds the return value will be the number of the threads set for work with the network adapter, otherwise it will be 0. The default value is 1.

Description:

Use AdpGetThreadCount to check the number of the threads set for work with the network adapter.

1. Please note, that if ThreadCount is greater than 1, then OnPacketReceive event handler also may be called by more than one thread simultaneously.

2. For Windows 95/98/ME this property always is set to 2, because under these operation systems PSSDK always uses 2 threads to increase performance of packets processing and asynchronous operations. The reason is the internal architecture of these operation systems, that doesn't allow to use several CPUs on multi-CPU systems.

3. If the ReceiveQueue property has been set before the network adapter opening, then while executing the code in such operating systems as NT/2000/XP/2003/Vista the ThreadCount will be greater than 1. This is due to the internal implementation of the HNAdapter component in the operating systems mentioned above.
See also:HNAdapter, MaxThreadCount, OnPacketReceive, AdpSetThreadCount, AdpGetReceiveQueue, AdpSetReceiveQueue