bstr_port_send_packet(3) — Subroutines
Name
bstr_port_send_packet − Sends a Packet to a Port (VODB only).
Syntax
bstr_t_status bstr_port_send_packet (
bstr_t_reference ∗destination_port,
bstr_t_reference ∗partner_port,
bstr_t_reference ∗packet,
bstr_t_reference ∗extension_1,
bstr_t_reference ∗extension_2,
bstr_t_reply reply,
bstr_t_descriptor ∗input_parameters,
bstr_t_packet_modifiers modifiers,
bstr_t_rcb ∗control,
bstr_t_sequence ∗output_parameters,
bstr_t_time ∗reply_time);
Description
The bstr_port_send_packet procedure sends the Packet specified by packet to destination_port.
The value for the input parameters to be forwarded to the user who receives the Packet, can be passed using the input_parameters argument.
If a reply is needed from the user who receives the Packet, the reply argument must be set to BSTR_C_REPLY_REQUESTED. In this case, the values of the output parameters, which will be provided by the replying user, will be returned at request completion in the output_parameter sequence.
Arguments
destination_port
access: read
The reference to the destination Port.
partner_port
access: read
The optional reference to a Port that the application intends to use for the receipt of Packets sent to it.
packet
access: read
The reference to the Packet being sent.
extension_1
access: read
Reserved for future use.
extension_2
access: read
Reserved for future use.
reply
access: read
Optional parameter to specify if the receiving user must reply to the Packet being sent. The following values are permitted:
•BSTR_C_REPLY_NOT_REQUESTED. Reply is not requested (default).
•BSTR_C_REPLY_REQUESTED. Reply is requested. The bstr_port_send_packet procedure can return the value of the Packet output parameters in the output_parameters argument.
input_parameters
access: read
The address of a bstr_t_descriptor data structure that specifies the number of elements and the address of an array containing the value of the Packet input parameter. Each array element contains a pointer to a bstr_t_named_value data structure.
The input_parameters argument is set to NULL if no input parameter values are supplied. The same applies if the length or data argument in the descriptor is set to zero or NULL, respectively. If an array element contains NULL, it means that the value of the corresponding input parameter has not been supplied.
Each bstr_t_named_value data structure contains the value, size and name (optional) of the corresponding Packet output parameter. The correspondence of a passed value to the Packet output parameter is based on the position of the value in the sequence.
modifiers
access: read
Reserved for future use.
control
access: read
The address of an optional request control block.
output_parameters
access: output
The address of a sequence which can be returned only if the reply argument is set to REPLY_REQUESTED. Each element in the sequence contains the value, size, and name (optional) of the corresponding Packet output parameter, as specified by the user who replied to the Packet.
The correspondence of a returned value to a Packet output parameter is based on its position in the sequence (that is, the first element in the sequence corresponds to the first Packet output parameter).
The significant fields of each element in the sequence are as follows:
•type. Set to BSTR_C_VALUE.
•name. The address of an empty or user-defined string that identifies the corresponding Packet output parameter.
•size. Contains the size of the value buffer.
•value. The address of a buffer where the Packet output parameter value is returned. If it is set to NULL, the value of the corresponding parameter is not specified. The information returned depends on the datatype associated with the Packet output parameter.
reply_time
access: output
The address of a bstr_t_time variable where the BASEstar Open time, of when the reply was originated, is returned.
Return Values
| BSTR_S_ABORTED | Operation aborted |
| BSTR_S_BAD_PARAMETER | Bad parameter value |
| BSTR_S_BAD_REFERENCE | Bad reference |
| BSTR_S_COMMUNICATION_ERROR | Communication error |
| BSTR_S_COM_PC_SIZE_MISMATCH | Number of bytes requested does not match the number of bytes returned |
| BSTR_S_FINISH | Request aborted by bstr_finish |
| BSTR_S_INTERNAL_ERROR | Internal error |
| BSTR_S_INTR | Operation interrupted |
| BSTR_S_INVALID_RCB | Invalid Request Control Block |
| BSTR_S_INVALID_USAGE | Invalid reference usage |
| BSTR_S_INVALID_VALUE | Invalid value |
| BSTR_S_NORMAL | Normal successful completion |
| BSTR_S_NOT_IMPLEMENTED | Not yet implemented |
| BSTR_S_NOT_INITIALIZED | BASEstar Open not initialized |
| BSTR_S_NO_MEMORY | Insufficient virtual memory |
| BSTR_S_SERVER_NOT_REACHABLE | Server not reachable |
| BSTR_S_TIMEOUT | Timeout expired |
| BSTR_S_PORT_NOT_CONNECTED | Not connected to Port |
| BSTR_S_PORT_NOT_EXISTING | Destination Port does not exist |
| BSTR_S_SOURCE_PORT_NOT_DEFINED | Source Port not defined |
| BSTR_S_CANNOT_DELIVER | The packet cannot be delivered to destination Port |
See Also
| bstr_port_receive_packet | # |
| bstr_port_reply_packet | # |