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

This function writes data to an open TCP connection synchronously and it will be blocked until it has finished writing all data.

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

>= 0: The data size of the write data. 

< 0: Error code, please check VM_TCP_RESULT.

Example
static VMINT g_tcp_sync_hd;
#define send ("GET / HTTP/1.1rnHost: www.mediatek.com:80rnrn")
void hl_tcp_sync(void)
{
   VMINT read_data;
   VMINT ret;
   g_tcp_sync_hd = vm_tcp_connect_sync("123.123.123.123", 80, VM_BEARER_DATA_ACCOUNT_TYPE_NON_PROXY);
   ret = vm_tcp_write_sync(g_tcp_sync_hd, send, strlen(send));
   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.