Force UTF-8 when sending WS-Discovery Probe
This commit is contained in:
parent
124d781699
commit
1558353672
|
@ -61,16 +61,19 @@ sub _notify_response
|
|||
}
|
||||
|
||||
sub send_multi() {
|
||||
my ($self, $address, $port, $data) = @_;
|
||||
my ($self, $address, $port, $utf8_string) = @_;
|
||||
|
||||
my $destination = $address . ':' . $port;
|
||||
my $socket = IO::Socket::Multicast->new(PROTO => 'udp',
|
||||
LocalPort=>$port, PeerAddr=>$destination, ReuseAddr=>1)
|
||||
|
||||
or die 'Cannot open multicast socket to ' . ${address} . ':' . ${port};
|
||||
|
||||
my $bytes = $utf8_string;
|
||||
utf8::encode($bytes);
|
||||
|
||||
$socket->mcast_ttl(1);
|
||||
$socket->send($data);
|
||||
$socket->send($bytes);
|
||||
}
|
||||
|
||||
sub receive_multi() {
|
||||
|
|
Loading…
Reference in New Issue