Internet Direct (Indy)
Home
PreviousUpNext
TIdFSPPacket.WritePacket Method

Forms the binary content for a packet used in an FSP protocol exchange.

Pascal
function WritePacket: TIdBytes;

TIdBytes - Binary content of the packet formed using properties in the object instance.

WritePacket is a TIdBytes function used to form the binary content for a packet used in an FSP protocol exchange. 

WritePacket creates an internal TIdBuffer instance used to capture the binary content in the packet, and to assign the content top the return value for the method. 

WritePacket ensures that the values in ExtraDataLen is updated to reflect the actual length of the ExtraData property prior to creating the binary content for the packet. 

WritePacket copies the byte values for the following properties into the internal buffer for the method: 

 

Cmd 
Key 
Data 
ExtraDataLen 

 

WritePacket calculates a checksum value for the contents of the Data and ExtraData properties and includes the result in the binary content for the packet. 

The bytes accumulated in the internal buffer are stored in the return value for the method, and the TIdBuffer instance is freed. 

Use ReadPacket to extract property values from the binary content for a packet.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.