Prg_Ipc_Port_Create_Listen()
Abstract
Creates a PRG IPC port with a given IP port number and listens for connection requests.
Syntax
Prg_Ipc_Port_Create_Listen (port_number, handler, ph_ptr)
| Argument | Type | Description |
|---|---|---|
port_number |
int |
the IP port number on which the created port will be listening |
handler |
PrgT_Ipc_Packet_Handler | handler function that will be called when any data comes into the port created |
Return Type
PrgT_Compcode
Return PrgC_Compcode_Success on success, PrgC_Compcode_Failure if failed
Header
prg_ipc.h
Details
Creates a PRG IPC port on given IP port number (e.g. 4537) and starts listening for connection requests to this port, then returns the port's handle by setting ph_ptr. This function also registers the handler for incoming data and the port status notification on that port.
If port_number is PRGC_IPC_LISTEN_PORT_ANY, then the port created will start listening on an IP port number determined by the calling program (to avoid possible IP port conflicts with other running programs). The actual IP port number can be obtained by calling Prg_Ipc_Port_Listen_Port_Number_Get() on the port handle returned.
The prototype for handler is given in PrgT_Ipc_Packet_Handler.