Skip Menu |

This queue is for tickets about the IO-Socket-Multicast CPAN distribution.

Report information
The Basics
Id: 76001
Status: open
Priority: 0/
Queue: IO-Socket-Multicast

People
Owner: bramble.andrew [...] gmail.com
Requestors: srinkes [...] genua.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Unable to send 0 Byte Payload UDP packets
Date: Fri, 23 Mar 2012 11:20:25 +0100
To: bug-IO-Socket-Multicast [...] rt.cpan.org
From: Stefan Rinkes <srinkes [...] genua.de>
Hello, mcast_send() currently does not allow to send 0 Byte packets. It croaks with: usage: $sock->mcast_send($data [,$address]) lib/IO/Socket/Multicast.pm: sub mcast_send { my $sock = shift; my $data = shift || croak 'usage: $sock->mcast_send($data [,$address])'; $sock->mcast_dest(shift) if @_; my $dest = $sock->mcast_dest || croak "no destination specified with mcast_send() or mcast_dest()"; return send($sock,$data,0,$dest); } IMHO it should be: my $data = shift // croak 'usage: $sock->mcast_send($data [,$address])'; Stefan Rinkes
On Fri Mar 23 06:20:44 2012, srinkes@genua.de wrote: Show quoted text
> Hello, > > mcast_send() currently does not allow to send 0 Byte packets. > > It croaks with: usage: $sock->mcast_send($data [,$address]) > > lib/IO/Socket/Multicast.pm: > > sub mcast_send { > my $sock = shift; > my $data = shift || croak 'usage: $sock->mcast_send($data [,$address])'; > $sock->mcast_dest(shift) if @_; > my $dest = $sock->mcast_dest || croak "no destination specified with > mcast_send() or mcast_dest()"; > return send($sock,$data,0,$dest); > } > > IMHO it should be: > > my $data = shift // croak 'usage: $sock->mcast_send($data [,$address])'; > > > Stefan Rinkes
Thanks Stefan , indeed I don't see a good reason to stop the caller from sending a zero byte payload if desired. Though I dislike // - that can also be avoided without any trouble.
On Fri Mar 23 07:11:07 2012, bramble wrote: Show quoted text
> On Fri Mar 23 06:20:44 2012, srinkes@genua.de wrote:
> > Hello, > > > > mcast_send() currently does not allow to send 0 Byte packets. > > > > It croaks with: usage: $sock->mcast_send($data [,$address]) > > > > lib/IO/Socket/Multicast.pm: > > > > sub mcast_send { > > my $sock = shift; > > my $data = shift || croak 'usage: $sock->mcast_send($data
[,$address])'; Show quoted text
> > $sock->mcast_dest(shift) if @_; > > my $dest = $sock->mcast_dest || croak "no destination specified with > > mcast_send() or mcast_dest()"; > > return send($sock,$data,0,$dest); > > } > > > > IMHO it should be: > > > > my $data = shift // croak 'usage: $sock->mcast_send($data [,$address])'; > > > > > > Stefan Rinkes
> > Thanks Stefan , indeed I don't see a good reason to stop the caller from > sending a zero byte payload if desired. Though I dislike // - that can > also be avoided without any trouble. > > >
Interestingly - for a zero byte payload - it becomes difficult to determine test if ( $sock->mcast_send($data) ) { } when it is returning (quite rightly) zero. Suggest in the case where the length($data) is zero , that it returns '0E0'
if ( defined $sock->mcast_send($data) ) { } On Fri Mar 23 07:42:52 2012, bramble wrote: Show quoted text
> Interestingly - for a zero byte payload - it becomes difficult to > determine test > if ( $sock->mcast_send($data) ) { > > } > > when it is returning (quite rightly) zero. > > Suggest in the case where the length($data) is zero , that it returns
'0E0' Show quoted text
>
Hello Sending the character '0' to mcast_send() will catch the exception. my $data = "\x30"; eval {    $socket->mcast_send($data, MCAST_DESTINATION); }; if($@) {warn $@;} I am currently using send() for workaround. Thank you. On 2012-3月-23 金 07:11:07, bramble wrote: Show quoted text
> On Fri Mar 23 06:20:44 2012, srinkes@genua.de wrote:
> > Hello, > > > > mcast_send() currently does not allow to send 0 Byte packets. > > > > It croaks with: usage: $sock->mcast_send($data [,$address]) > > > > lib/IO/Socket/Multicast.pm: > > > > sub mcast_send { > > my $sock = shift; > > my $data = shift || croak 'usage: $sock->mcast_send($data [,$address])'; > > $sock->mcast_dest(shift) if @_; > > my $dest = $sock->mcast_dest || croak "no destination specified with > > mcast_send() or mcast_dest()"; > > return send($sock,$data,0,$dest); > > } > > > > IMHO it should be: > > > > my $data = shift // croak 'usage: $sock->mcast_send($data [,$address])'; > > > > > > Stefan Rinkes
> > Thanks Stefan , indeed I don't see a good reason to stop the caller from > sending a zero byte payload if desired. Though I dislike // - that can > also be avoided without any trouble. > > >
Subject: Re: [rt.cpan.org #76001] Unable to send 0 Byte Payload UDP packets
Date: Mon, 29 Oct 2018 13:16:56 -0400
To: bug-IO-Socket-Multicast [...] rt.cpan.org
From: Lincoln Stein <lincoln.stein [...] gmail.com>
This looks like a reasonable fix. Am I still the primary maintainer of this module? It has been years! Lincoln On Mon, Oct 29, 2018 at 1:01 PM Gogo Yubari via RT < bug-IO-Socket-Multicast@rt.cpan.org> wrote: Show quoted text
> Queue: IO-Socket-Multicast > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=76001 > > > Hello > Sending the character '0' to mcast_send() will catch the exception. > > my $data = "\x30"; > eval { > $socket->mcast_send($data, MCAST_DESTINATION); > }; > if($@) {warn $@;} > > I am currently using send() for workaround. > Thank you. > > > On 2012-3月-23 金 07:11:07, bramble wrote:
> > On Fri Mar 23 06:20:44 2012, srinkes@genua.de wrote:
> > > Hello, > > > > > > mcast_send() currently does not allow to send 0 Byte packets. > > > > > > It croaks with: usage: $sock->mcast_send($data [,$address]) > > > > > > lib/IO/Socket/Multicast.pm: > > > > > > sub mcast_send { > > > my $sock = shift; > > > my $data = shift || croak 'usage: $sock->mcast_send($data
> [,$address])';
> > > $sock->mcast_dest(shift) if @_; > > > my $dest = $sock->mcast_dest || croak "no destination specified with > > > mcast_send() or mcast_dest()"; > > > return send($sock,$data,0,$dest); > > > } > > > > > > IMHO it should be: > > > > > > my $data = shift // croak 'usage: $sock->mcast_send($data
> [,$address])';
> > > > > > > > > Stefan Rinkes
> > > > Thanks Stefan , indeed I don't see a good reason to stop the caller from > > sending a zero byte payload if desired. Though I dislike // - that can > > also be avoided without any trouble. > > > > > >
>
-- *Lincoln Stein* Head, Adaptive Oncology, OICR Senior Principal Investigator, OICR Professor, Department of Molecular Genetics, University of Toronto <http://goog_1828306398> *Ontario Institute for Cancer Research* MaRS Centre 661 University Avenue Suite 510 Toronto, Ontario Canada M5G 0A3 Tel: 416-673-8514 Mobile: 416-817-8240 Email: lincoln.stein@gmail.com Toll-free: 1-866-678-6427 Twitter: @OICR_news *Executive Assistant* *Melisa Torres* Tel: 647-259-4253 Email: melisa.torres@oicr.on.ca <stacey.quinn@oicr.on.ca> www.oicr.on.ca This message and any attachments may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this message in error, please contact the sender and delete all copies. Opinions, conclusions or other information contained in this message may not be that of the organization.