added Line parser and recv_pass, recv_error; added send command with a P10Formatter
[PHP-P10.git] / Uplink / Client.class.php
index 834448c4ba362fdd67c0b87d328a93b83119e2e0..c7ecc4cf40440bf942ccac22cd9d0003288a8510 100644 (file)
@@ -30,6 +30,9 @@
  * bool connect(String $host, int $port, String $bind = null, bool $ssl = false, int $blocking = 0)
  *     connects the socket to $host:$port with the provided options
  *
+ * void disconnect()
+ *     disconnects the socket
+ *
  * bool connected()
  *     returns the state of the socket (true if the socket is connected with the server)
  *
@@ -72,6 +75,12 @@ class Client {
                        return false;
        }
        
+       public function disconnect() {
+               if($this->socket == null) return;
+               fclose($this->socket);
+               $this->socket = null;
+       }
+       
        public function connected() {
                if($this->socket == null) return false;
                $read = array($this->socket);