opensrs\Base::init_socket PHP Method

init_socket() private method

Method to initialize a socket connection to the OpenSRS server.
Since: 3.1
private init_socket ( ) : boolean
return boolean True if connected
    private function init_socket()
    {
        if ($this->is_connected()) {
            return true;
        }
        $this->_socket = fsockopen(CRYPT_TYPE . '://' . OSRS_HOST, OSRS_SSL_PORT, $this->_socketErrorNum, $this->_socketErrorMsg, $this->_socketTimeout);
        if (!$this->_socket) {
            return false;
        } else {
            return true;
        }
    }