Package DE_EPAGES::WebInterface::API::SequenceProtocol
A simple protocol to ensure ordering and identification of queries sent via UDP
Functions
new
Creates a new SequenceProtocol object.
Syntax |
$Protocol = DE_EPAGES::WebInterface::API::SequenceProtocol->new($UDPClient); |
Example |
$Protocol = DE_EPAGES::WebInterface::API::SequenceProtocol->new($UDPClient); my $PacketId = $Protocol->send('Hello'); my $Response = $Protocol->receive($PacketId); |
Input |
|
Return |
|
receive
Receives the response to a previously sent request identified by $PacketId
Syntax |
my $Response = $SequenceProtocol->receive( $PacketId, $TimeoutSec, $MaxLength ); |
Input |
|
Return |
|
receiveAll
Receives the responses to a previously sent request identified by $PacketId
Syntax |
my $Responses = $SequenceProtocol->receiveAll( $PacketId, $TimeoutSec, $MaxLength ); |
Input |
|
Return |
|
send
Sends a message containing $Data. Prepends a message identificator to $Data.
Syntax |
$PacketId = $SequenceProtocol->send( $Data ); |
Input |
|
Return |
|
sendReceive
Sends a message containing $Data, then waits for and returns a response
Syntax |
my $Response = $SequenceProtocol->sendReceive( $Data ); |
Input |
|
Return |
|
sendReceiveAll
Sends a message containing $Data, then waits for and returns all responses
Syntax |
my $Responses = $SequenceProtocol->sendReceiveAll( $Data ); |
Input |
|
Return |
|