Anonymous
public php v1 · immutable function connect($ip, $port) { $this->ip = $ip; $this->port = $port; if(!$this->usesockets) { $this->socket = fsockopen($this->ip, $this->port, $errornum, $errorstr, 30); if ($this->socket) { $this->log($errorstr." (".$errornum.")"); } } else { $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); socket_connect($this->socket, $this->ip, $this->port); if ($this->socket) { $this->log("Couldn't connect to {$this->ip} on port {$this->port}."); } } }