Syntax
VM_TCP_SERVER_HANDLE vm_tcp_server_init_sync(
    VM_BEARER_DATA_ACCOUNT_TYPE apn, 
    VMINT port
);
ContentsIndex
PreviousUpNext
vm_tcp_server_init_sync
Example
Syntax
VM_TCP_SERVER_HANDLE vm_tcp_server_init_sync(
    VM_BEARER_DATA_ACCOUNT_TYPE apn, 
    VMINT port
);
Description

This function initiates socket server synchronously.

Parameters
Parameters 
Description 
VM_BEARER_DATA_ACCOUNT_TYPE apn 
[IN] The APN ID. 
VMINT port 
[IN] The Port number associated to the server. 
Returns

>=0: server handle. 

< 0: error code in the VM_TCP_RESULT.

Example
 void hl_tcp_sync_srv(void)
 {
     vm_sockaddr_t addr;
     VMINT ret;
     char buf[1024] = {0};
     VMINT hdl_c;
     VMINT hdl_s = vm_tcp_server_init_sync(1, 3500);
     hdl_c = vm_tcp_server_accept_sync(hdl_s, &addr);
     ret = vm_tcp_server_read_sync(hdl_c, buf, 1024);
     ret = vm_tcp_server_write_sync(hdl_c, "aaa", 3);
     vm_tcp_server_close_client_sync(hdl_c);
 }
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.