Dies ist die alte 4D Dokumentations-Website. Die neue und aktualisierte Dokumentation finden Sie unter developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
TCP_Receive
|
TCP_Receive ( tcp_ID ; Text ) -> Funktionsergebnis | ||||||||
Parameter | Typ | Beschreibung | ||||||
tcp_ID | Lange Ganzzahl |
![]() |
Reference to an open TCP session | |||||
Text | Text |
![]() |
Received Text | |||||
Funktionsergebnis | Ganzzahl |
![]() |
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
Produkt: 4D
Thema: IC TCP/IP
Nummer:
88930
Erstellt: 4D Internet Commands 6.5
4D Internet Commands ( 4D v20 R7)