Permalink
Browse files

Convert address array into packed sockaddr

  • Loading branch information...
Leont committed Apr 27, 2012
1 parent 0275b69 commit eb5075171655053ead14a3b25709f6c2879ed493
Showing with 2 additions and 0 deletions.
  1. +1 −0 Changes
  2. +1 −0 lib/AnyEvent/Handle/UDP.pm
View
@@ -1,6 +1,7 @@
Revision history for AnyEvent-Handle-UDP
{{$NEXT}}
+ Make push_send accept an address array too
0.033 2012-02-19 17:35:10 Europe/Amsterdam
Make push_send optionally take a $cv, and only return one if called in non-void context
@@ -175,6 +175,7 @@ my %non_fatal = map { ( $_ => 1 ) } EAGAIN, EWOULDBLOCK, EINTR;
sub push_send {
my ($self, $message, $to, $cv) = @_;
+ $to = AnyEvent::Socket::pack_sockaddr($to->[0], AnyEvent::Socket::parse_address($to->[1])) if ref $to;
$cv ||= defined wantarray ? AnyEvent::CondVar->new : undef;
if ($self->autoflush and ! @{ $self->{buffers} }) {
my $ret = $self->_send($message, $to, $cv);

0 comments on commit eb50751

Please sign in to comment.