Packet Sniffer SDK VCL Edition

HNAdapter :: Methods :: AsyncSend

 Previous Next

Sends a packet asynchronously.

Syntax:

function AsyncSend(pPacket: Pointer;
                PacketSize: DWORD;
                     Count: DWORD;
                       Key: Pointer): DWORD;

Parameters:

pPacket

[in] A pointer to the packet.

PacketSize

[in] The packet size.

Count

[in] The number of times this packet must be sent.

Key

[in] A user-defined parameter.

Return values:

HNERR_OKThe packet has been sent successfully.
HNERR_ADAPTER_NOT_OPENEDThe adapter has not been opened, see the OpenAdapter method.
HNERR_COUNT_ERRThe Count parameter value must be greater than 0.
HNERR_SIZE_ERRThe PacketSize parameter value is greater than the maximum size, see the MaxPacketSize.
HNERR_ADDR_ERRpPacket has the wrong value (a memory reading error).
HNERR_ADAPTER_REQ_ERRAn internal driver request error.

Description:

After the network adapter has been opened successfully by OpenAdapter, you can send a raw packet directly, without using the OS functions. This packet will be sent asynchronously. Use OnAsyncSend to assure this packet has been sent successfully.

This method cannot work with devices recognized as atWAN. See HNNetAdapterType.
See also:Packets processing diagram, HNAdapter, HNNetAdapterType, OpenAdapter, MaxPacketSize, SyncSend, OnAsyncSend