public function __construct($url) { $this->url = str_replace("ws://", "http://", $url); preg_match("!^http://(.*):(\\d+)/(.*)\$!", $this->url, $match); $this->ip = $match[1]; $this->port = $match[2] + 1; $this->scope = $match[3]; \eTools\Utils\Logger::log("Setting WebSocket fix to " . $this->ip . ":" . $this->port); if (self::$sock == null) { self::$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); } }