Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added get_socket_path util method and fixed unix socket server exampl…

…e to accomodate changes done in socket server class contructor
  • Loading branch information...
commit 3a3fc78c0460530fc796a1802590ca12cb504a13 1 parent 2abb54b
@abhinavsingh abhinavsingh authored
Showing with 6 additions and 2 deletions.
  1. +1 −1  examples/echo_unix_sock_server.php
  2. +5 −1 jaxl.php
View
2  examples/echo_unix_sock_server.php
@@ -53,7 +53,7 @@ function on_request($client, $raw) {
}
@unlink($argv[1]);
-$server = new JAXLSocketServer('unix://'.$argv[1], 'on_request');
+$server = new JAXLSocketServer('unix://'.$argv[1], NULL, 'on_request');
JAXLLoop::run();
echo "done\n";
View
6 jaxl.php
@@ -345,6 +345,10 @@ public function unsubscribed($to) {
));
}
+ public function get_socket_path() {
+ return ($this->cfg['port'] == 5223 ? "ssl" : "tcp")."://".$this->cfg['host'].":".$this->cfg['port'];
+ }
+
public function start($opts=array()) {
// is bosh bot?
if(@$this->cfg['bosh_url']) {
@@ -374,7 +378,7 @@ public function start($opts=array()) {
$this->add_cb('on_connect', array($this, 'start_stream'));
// connect to the destination host/port
- if($this->connect(($this->cfg['port'] == 5223 ? "ssl" : "tcp")."://".$this->cfg['host'].":".$this->cfg['port'])) {
+ if($this->connect($this->get_socket_path())) {
// emit
$this->ev->emit('on_connect');
Please sign in to comment.
Something went wrong with that request. Please try again.