You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by mc...@apache.org on 2013/01/18 21:56:35 UTC
svn commit: r1435340 -
/qpid/proton/trunk/proton-c/bindings/perl/lib/qpid/proton/Messenger.pm
Author: mcpierce
Date: Fri Jan 18 20:56:35 2013
New Revision: 1435340
URL: http://svn.apache.org/viewvc?rev=1435340&view=rev
Log:
PROTON-176: Fixes to qpid::proton::Messenger found by unit tests.
These fixes address issues discovered while writing the unit tests for
the Messenger class.
Modified:
qpid/proton/trunk/proton-c/bindings/perl/lib/qpid/proton/Messenger.pm
Modified: qpid/proton/trunk/proton-c/bindings/perl/lib/qpid/proton/Messenger.pm
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/perl/lib/qpid/proton/Messenger.pm?rev=1435340&r1=1435339&r2=1435340&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/perl/lib/qpid/proton/Messenger.pm (original)
+++ qpid/proton/trunk/proton-c/bindings/perl/lib/qpid/proton/Messenger.pm Fri Jan 18 20:56:35 2013
@@ -23,6 +23,9 @@ use cproton_perl;
package qpid::proton::Messenger;
+our $AUTO_ACCEPT = $cproton_perl::PN_ACCEPT_MODE_AUTO;
+our $MANUAL_ACCEPT = $cproton_perl::PN_ACCEPT_MODE_MANUAL;
+
sub new {
my ($class) = @_;
my ($self) = {};
@@ -42,12 +45,17 @@ sub DESTROY {
sub get_name {
my ($self) = @_;
- return cproton_perl::pn_messenger_get_name($self->{_impl});
+ return cproton_perl::pn_messenger_name($self->{_impl});
}
sub set_timeout {
my ($self) = @_;
- cproton_perl::pn_messenger_set_timeout($self->{_impl}, $_[1]);
+ my $timeout = $_[1];
+
+ $timeout = 0 if !defined($timeout);
+ $timeout = int($timeout);
+
+ cproton_perl::pn_messenger_set_timeout($self->{_impl}, $timeout);
}
sub get_timeout {
@@ -55,6 +63,50 @@ sub get_timeout {
return cproton_perl::pn_messenger_get_timeout($self->{_impl});
}
+sub set_accept_mode {
+ my ($self) = @_;
+ my $mode = $_[1];
+
+ die "acccept mode must be defined" if !defined($mode);
+
+ cproton_perl::pn_messenger_set_accept_mode($self->{_impl}, $mode);
+}
+
+sub get_accept_mode {
+ my ($self) = @_;
+ return cproton_perl::pn_messenger_get_accept_mode($self->{_impl});
+}
+
+sub set_outgoing_window {
+ my ($self) = @_;
+ my $window = $_[1];
+
+ $window = 0 if !defined($window);
+ $window = int($window);
+
+ cproton_perl::pn_messenger_set_outgoing_window($self->{_impl}, $window);
+}
+
+sub get_outgoing_window {
+ my ($self) = @_;
+ return cproton_perl::pn_messenger_get_outgoing_window($self->{_impl});
+}
+
+sub set_incoming_window {
+ my ($self) = @_;
+ my $window = $_[1];
+
+ $window = 0 if !defined($window);
+ $window = int($window);
+
+ cproton_perl::pn_messenger_set_incoming_window($self->{_impl}, $window);
+}
+
+sub get_incoming_window {
+ my ($self) = @_;
+ return cproton_perl::pn_messenger_get_incoming_window($self->{_impl});
+}
+
sub get_error {
my ($self) = @_;
return cproton_perl::pn_messenger_error($self->{_impl});
@@ -100,6 +152,17 @@ sub get_private_key {
return cproton_perl::pn_messenger_get_private_key($self->{_impl});
}
+sub set_password {
+ my ($self) = @_;
+
+ cproton_perl::pn_messenger_set_password($self->{_impl}, $_[1]);
+}
+
+sub get_password {
+ my ($self) = @_;
+ return cproton_perl::pn_messenger_get_password($self->{_impl});
+}
+
sub set_trusted_certificates {
my ($self) = @_;
cproton_perl::pn_messenger_set_trusted_certificates($self->{_impl}, $_[1]);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org