| 4D v18TCP_Receive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | 
    4D v18
 TCP_Receive 
         | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TCP_Receive ( tcp_ID ; text ) -> Function result | ||||||||
| Parameter | Type | Description | ||||||
| tcp_ID | Longint |   | Reference to an open TCP session | |||||
| text | Text |   | Received Text | |||||
| Function result | Integer |   | Error Code | |||||
Given a long integer reference to an established TCP Session, the TCP_Receive command receives packets of data into text.
tcp_ID is a long integer reference to an open TCP session as established with either the TCP_Open or TCP_Listen command.
text is the text received. When receiving data via TCP packets, you cannot count on all of your data being received by a single TCP_Receive call. The TCP_Receive command is usually called within a Repeat loop which continually checks on the status of the connection or is scanning for a known value.
 C_LONGINT($tcp_id)
 C_TEXT($webpage;$buffer)
 C_LONGINT(vState;$error)
 $webpage:=""
 vState:=0
 Repeat
    $error:=TCP_Receive($tcp_id;$buffer)
    $error:=TCP_State($tcp_id;vState)
    $webpage:=$webpage+$buffer
 Until((vState=0)|($error#0)) //until host closes connection or an error
	Product:  4D
	Theme:  IC TCP/IP
	Number:  
        88930
        
        
        
	
	Created:  4D Internet Commands 6.5
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	4D Internet Commands ( 4D v18)
	
	
 Add a comment
Add a comment