Package DE_EPAGES::Core::API::Object::UDPMultiClient
UDP client class for multiplexed servers
Functions
new
Creates a new UDPMultiClient object.
Syntax |
$UDPMultiClient = DE_EPAGES::Core::API::Object::UDPMultiClient->new($aHosts); |
Example |
my $UDPMultiClient = DE_EPAGES::Core::API::Object::UDPMultiClient->new([['servername', 10043]]); $UDPMultiClient->send('Hello'); |
Input |
|
Return |
|
numConnections
Returns the number of active socket connections for this client
Syntax |
$UDPClient->numConnections; |
Return |
|
receive
Receives UDP messages
Syntax |
my $Response = $UDPMultiClient->receive( $TimeoutSec, $MaxLength ); |
Input |
|
Return |
|
receiveAll
Receives UDP messages from all clients
Syntax |
my $Responses = $UDPMultiClient->receiveAll( $TimeoutSec, $MaxLength ); |
Input |
|
Return |
|
send
Sends an UDP message containing $Data.
Syntax |
$UDPClient->send( $Data ); |
Input |
|
sendReceive
Sends an UDP message containing $Data, then waits for and returns a response
Syntax |
my $Response = $UDPMultiClient->sendReceive( $Data, $TimeoutSec, $MaxLength ); |
Input |
|
Return |
|
sendReceiveAll
Sends an UDP message containing $Data, then waits for and returns all responses
Syntax |
my $Responses = $UDPMultiClient->sendReceiveAll( $Data, $TimeoutSec, $MaxLength ); |
Input |
|
Return |
|
useAutoflush
Sets the autoflush flag of the client. Enabling autoflush discards all data still present on the receiving ends of the underlying sockets before sending a new request. This data is usually redundant and unwanted. Disable autoflush if you want to receive all responses (even the redundant ones) from all connected servers. We need this when using UDPMultiClient in conjunction with DE_EPAGES::WebInterface::API::SequenceProtocol.
Syntax |
my $Autoflush = $UDPMultiClient->useAutoflush(); $UDPMultiClient->useAutoflush(0); |
Input |
|
Return |
|