Topic Path: Symbol Reference > Classes > TIdFSPPacket Class > TIdFSPPacket Methods > WritePacket Method
ContentsIndexHome
PreviousUpNext
TIdFSPPacket.WritePacket Method

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

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.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.