4D v13.2

TCP_ReceiveBLOB

Home

 
4D v13.2
TCP_ReceiveBLOB

TCP_ReceiveBLOB 


 

TCP_ReceiveBLOB ( tcp_ID ; blobToReceive ) -> Function result 
Parameter Type   Description
tcp_ID  Longint in Reference to an open TCP session
blobToReceive  BLOB in BLOB to receive data
Function result  Integer in Error Code

Given a long integer reference to an established TCP session, the TCP_ReceiveBLOB command receives packets of data into blobToReceive.

This command performs the same action as TCP_Receive, except that it will receive data in a BLOB instead of a text, which allows bypassing the 32K text limitation. You can then receive binary objects.

tcp_ID is a long integer reference to an open TCP session as established with either the TCP_Open or TCP_Listen command.

blobToReceive is the BLOB which receives data. When receiving data via TCP packets, you cannot count on all of your data being received by a single TCP_ReceiveBLOB call. The TCP_ReceiveBLOB command is usually called within a Repeat...Until loop which continually checks on the status of the connection or is scanning for a known value.

Example  

This example shows the typical structure of a method using TCP_ReceiveBLOB:

 C_BLOB($Blob_Received;$Blob_All)
 C_LONGINT($srcpos;$dstpos)
 Repeat
    $Err:=TCP_ReceiveBLOB($TCP_ID;$Blob_Received )
    $Err:=TCP_State($TCP_ID;$State)
    $srcpos:=0
    $dstpos:=BLOB size($Blob_All)
  `Concatenating received Blobs
    COPY BLOB($Blob_Received;$Blob_All;$srcpos;$dstpos;BLOB size($Blob_Received))
 Until(($State=0)|($Err#0))

 
PROPERTIES 

Product: 4D
Theme: IC TCP/IP
Number: 88887

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D Internet Commands 6.7

 
SEE ALSO 

TCP_Listen
TCP_Open
TCP_Receive
TCP_SendBLOB