Syntax
VMINT vm_tcp_read_sync(
    VM_TCP_HANDLE handle, 
    void* buffer, 
    VMUINT length
);
ContentsIndex
PreviousUpNext
vm_tcp_read_sync
Example
Syntax
VMINT vm_tcp_read_sync(
    VM_TCP_HANDLE handle, 
    void* buffer, 
    VMUINT length
);
Description

This function reads data from a TCP connection synchronously and it will blocked until it has finished reading all data.

Parameters
Parameters 
Description 
VM_TCP_HANDLE handle 
[IN] The TCP handle. 
void* buffer 
[OUT] The data buffer. 
VMUINT length 
[OUT] The data length. 
Returns

> 0: The size of the data to read. 

= 0: The server sent FIN. 

< 0: Error code in VM_TCP_RESULT

Example
 static VMINT g_tcp_sync_hd;
 void hl_tcp_sync(void)
 {
     VMINT read_data;
     VMBYTE buf[1024];
     VMINT ret;
     g_tcp_sync_hd = vm_tcp_connect_sync("123.123.123.123", 80, VM_BEARER_DATA_ACCOUNT_TYPE_GPRS_NON_PROXY);
     read_data = vm_tcp_read_sync(g_tcp_sync_hd, buf, 1024);
     ret = vm_tcp_close_sync(g_tcp_sync_hd);
 }
File

vmtcp.h

Group
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.