documentation -- V4MD Example with SSL

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Nov 6 15:15:06 CST 2008


On 11/6/08 9:01 PM, "Michael Lee" <michaeljlee at comcast.net> wrote:

Hi Michael,

> The example AutoIncrement.dir works fine unless I set gSSLEnable to
> true. In this case, Director crashes when I Test Movie, every time.
> 
> Calling UseSSL in my project also crashes Director.  Below is  my
> code. If I set gSSLEnable to true, causing gConnection.UseSSL() to be
> called, Director crashes every time.

I have add this to Mantis.
    http://www.valentina-db.com/bt/view.php?id=3731

We will try to reproduce it on this exmaple


> global Valentina
> global vDb
> global gClient
> global gSSLEnable
> global gConnection
> 
> on startMovie
>    Valentina_Init
>    vDB = openDatabase()
> end
> 
> on stopMovie
>    Valentina_Shutdown
> end
> 
> on Valentina_Init
>    clearGlobals()
> 
>    InitializeValentinaReferences()
> 
>    if( gClient ) then
>      Valentina.InitClient( 10 )
>      if CheckValError() then
>        exit
>      end if
>    else
>      Valentina.Init(8 * 1024 * 1024)
>    end if
> 
>    if Valentina.cacheSize = 0 then
>      alert ("Could not initialize Valentina. See V4MD_Log.txt file
> for errors")
>      exit
>    end if
> 
>    Valentina.debugLevel = #kLogParams -- set to #kLogNothing before
> release
>    Valentina.logToMessageWindow = true
>    Valentina.logToFile(true, true)  -- remove on release!
> end
> 
> on InitializeValentinaReferences ()
>    gClient = true
>    -- To enable SSL set gSSLEnable to true
>    gSSLEnable = false -- CAUSES CRASH IF TRUE!
> 
>    Valentina = new (Xtra("Valentina"))
>    if not objectP(Valentina) then
>      alert "Cannot set reference to Valentina Xtra!"
>    end if
> end
> 
> 
> on openDatabase ()
>    db = void
>    if( gClient ) then
> 
>      if( gSSLEnable ) then thePort = 15435  -- this matches what is
> in VServer_Embedded.ini
>      else  thePort = 15433  -- this matches what is in
> VServer_Embedded.ini
> 
>      gConnection = new(Xtra "VConnection", "localhost", "sa", "sa",
> thePort )
>      if CheckValError() then exit -- No error, even if we can't
> connect! We don't get the error until we call Open below
> 
>      if( gSSLEnable ) then
>        gConnection.UseSSL()
>        if CheckValError() then exit
>      end if
> 
>      gConnection.Open()
>      if CheckValError() then exit
> 
>      --db = new VDatabase( gConnection )
>      db = new(Xtra "VDatabase", #kClient, gConnection)
>      if CheckValError() then exit
> 
>      -- server.RegisterDatabase( "test.vdb" )
>      if CheckValError() then exit
> 
>      db.Open( "test.vdb" )
>      if CheckValError() then exit
> 
>    else
>      db = new(Xtra "VDatabase", #kLocal)
>      if CheckValError() then exit
> 
>      db.Open( the moviepath & "test.vdb" )
>      if CheckValError() then exit
> 
>    end if
> 
>    if(not objectP(db)) then
>      alert("Cannot create VDatabase Xtra!")
>    end if
> 
>    return db
> end
> 
> 
> on Valentina_Shutdown
>    -- Clean up sample.
>    if objectP(vDb) then
>      vDb.close()
>      --   vDb.throwOut()
>      vDb = void
>    end if
> 
>    if objectP(Valentina) then
>      -- When we finish work with Valentina engine we should shutdown it.
>      if( gClient ) then
>        if objectP(gConnection) then
>          gConnection.Close()
>        end if
> 
>        Valentina.shutDownClient()
>      else
>        Valentina.shutDown()
>      end if
>    end if
> 
>    Valentina = void
> end
> 
> 
> on CheckValError ()
> 
>    if objectP(Valentina) then
>      if ( Valentina.lastError <> 0 ) then
>        alert "ERROR: " & Valentina.lastErrorSymbol & "(" &
> Valentina.lastErrorString & ")"
>        return 1
>      else
>        return 0
>      end if
>    end if
> 
> end

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list