Permalink
Browse files

Merge pull request #273 from tarasfrompir/master

Мелкие исправления в Ядре джалдера
  • Loading branch information...
T-REX-XP committed Sep 11, 2018
2 parents 8ae0875 + 7fa7724 commit 8f92af0ff3bb37b1385f45c312ba8d0684c2a5c7
Showing with 3 additions and 1 deletion.
  1. +3 −1 modules/ssdp_finder/upnp/vendor/jalder/upnp/src/Core.php
@@ -41,12 +41,14 @@ public function search($st = 'ssdp:all', $mx = 2, $man = 'ssdp:discover', $from
$request .= 'ST: '.$st.''."\r\n";
$request .= 'USER-AGENT: '.$this->user_agent."\r\n";
$request .= "\r\n";
$socket = socket_create(AF_INET, SOCK_DGRAM, 0);
socket_set_option($socket, SOL_SOCKET, SO_BROADCAST, true);
socket_sendto($socket, $request, strlen($request), 0, '255.255.255.255', 1900);
socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec'=>$sockTimout, 'usec'=>'50'));
$response = array();
do {
$buf = null;
if (($len = @socket_recvfrom($socket, $buf, 1024, 0, $this->getLocalIp(), $port)) == -1) {
if (($len = @socket_recvfrom($socket, $buf, 1024, 0, $ip, $port)) == -1) {
echo "socket_read() failed: " . socket_strerror(socket_last_error()) . "\n";
}
if(!is_null($buf)){

0 comments on commit 8f92af0

Please sign in to comment.