Prg_Ipc_Port_Connect_To()

Abstract

Connects to another program's listening PRG Ipc port and establish two-way communication.

Syntax

Prg_Ipc_Port_Connect_To (ip_addr, port_number, handler, ph_ptr)
Argument Type Description
ip_addr const char * the name or IP address of the host on which the listening program is running
port_number int the IP port number of the listening program
handler PrgT_Ipc_Packet_Handler the handler that will be called when the listening program sends any data to this program
ph_ptr PrgT_Ipc_Port_Handle * input argument, address of a port handle that will be filled with proper info

Return Type

PrgT_Compcode

Return PrgC_Compcode_Success on success, PrgC_Compcode_Failure if failed

prg_ipc.h

Details

Connect to another program listening on the given PRG Ipc port, thus establishing two-way communication with the listener.

For this function to succeed, the listener program must have called Prg_Ipc_Port_Create_Listen() to listen on the given port. The listening program may be running on a different host.

Once this function succeeds, the input argument ph_ptr will be filled with proper the information, so that the calling program can call Prg_Ipc_Packet_Send() on the PRG IPC port pointed to by ph_ptr to send data to the listener program. On the other side, the listener can call Prg_Ipc_Packet_Send() on its PRG IPC port handle (created through Prg_Ipc_Port_Create_Listen()) to send data to the calling program.

The prototype for handler is given in PrgT_Ipc_Packet_Handler.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com