Method ITcIoUdpProtocol:SendData

Sends data.

Syntax

HRESULT TCOMAPI SendData(ULONG ipAddr, USHORT udpDestPort, USHORT udpSrcPort, ULONG nData, PVOID pData, bool bCalcUdpCheckSum=0, ETYPE_VLAN_HEADER* pVlan=0) 

Method ITcIoUdpProtocol:SendData 1: Return value

Type

Description

HRESULT

Indicates success, see Return values.

Parameter

Name

Type

Description

ipAddr

ULONG

The IP address of the receiver.
IP addresses are displayed with the most significant element in the last position. (Example: 192.168.2.1 -> 01 02 A8 C0)

udpDestPort

USHORT

The port of the receiver.

udpSrcPort

USHORT

The port of the sender.

nData

ULONG

Number of date to be sent in bytes.

pData

PVOID

Pointer to the data to be sent.

bCalcUdpCheckSum

BOOL

Indicates whether the checksum should be calculated.

pVlan

ETYPE_VLAN_HEADER

ETYPE_VLAN_HEADER structure, see below.

The VLAN header represents information about the VLAN.

typedef struct _ETYPE_VLAN_HEADER
{
USHORT VLanType;
unsigned short VLanIdH   : 4;
unsigned short reserved1 : 1;
unsigned short Priority  : 3;
unsigned short VLanIdL   : 8;
} ETYPE_VLAN_HEADER, *PETYPE_VLAN_HEADER;