The Set_Partner_Port (CMSPP) call sets the port number for TCP/IP for the partner application and in doing so also sets the PORT conversation characteristic. The call overwrites the value assigned using the Initialize_Conversation call. It may no longer be issued after an Allocate call.
The function is one of the additional functions of the UPIC carrier systems; it is not a component of the CPI-C interface.
UPIC-Local on Unix, Linux and Windows systems:
Connection via UPIC local does not support the Set_Partner_Port call.
CMSPP (conversation_ID, listener_port, return_code)
Parameters
--> conversation_ID | Conversation identifier |
--> port_number | Specifies which port number is searched for in the communication system by the partner application. |
<-- return_code | Result of the function call |
Result (return_code)
CM_OK
The call is OK.
CM_CALL_NOT_SUPPORTED
The function is not supported. This return code occurs for UPIC-L and for UPIC-R on BS2000 systems:
On Unix, Linux and Windows systems, this code is always returned with UPIC-L. It indicates to the program that a port number cannot be assigned because UPIC-L does not require this information as a result of the underlying communication system.
The code is only returned with UPIC-R on BS2000 systems in the event that the UPIC library on the BS2000 system is used together with CMX. The CMX communication system used by UPIC-R does not provide any option on
BS2000 systems for passing IP addresses for addressing the partner application at the interface. If the UPIC library uses the Socket interface as its communication system, the code is never returned.
CM_PROGRAM_PARAMETER_CHECK
The value of conversation_ID or port_number is invalid.
CM_PROGRAM_STATE_CHECK
The conversation is not in the “Initialize” state.
CM_PRODUCT_SPECIFIC_ERROR
The UPIC instance could not be found.
State change
The call does not change the state of the conversation.
Behavior in the event of errors
CM_PROGRAM_PARAMETER_CHECK
Modify program.
CM_PROGRAM_STATE_CHECK
Modify program.
CM_PRODUCT_SPECIFIC_ERROR
The operating system cannot provide sufficient memory for the internal buffers. Check whether the memory requirements of your program are too high and if necessary reboot your system.
CM_CALL_NOT_SUPPORTED
This is not necessarily an error: If the application is intended for both UPIC-L and UPIC-R on Unix, Linux and Windows systems this return code just means that the application is linked to a UPIC-L library. The program can take note of this return code and avoid making further calls to set address information.
On BS2000 systems, this return code means that the application is connected to UPIC-R and CMX. The program can remember this return code and then no longer requires the Set_Partner_IP_Address and Set_Partner_Port calls.
CM_ENTRY Set_Partner_Port ( unsigned char CM_PTR conversation_ID, CM_INT32 CM_PTR port_number, CM_RETURN_CODE CM_PTR return_code )