Skip to content

Context

Jiowcl edited this page Jun 18, 2021 · 1 revision

Context

Get and Set Context

#Include "../Core/ZeroMQ.bi"

Dim lpszLibZmqDll As String = "libzmq.dll"

Dim hLibrary As Any Ptr = ZmqDllOpen(lpszLibZmqDll)

If hLibrary > 0 Then
    Dim Context As Any Ptr = ZmqCtxNew(hLibrary)

    Print("Context: " & ZmqCtxGet(hLibrary, Context, ZMQ_MAX_SOCKETS))

    ZmqCtxShutdown(hLibrary, Context)
    ZmqDllClose(hLibrary)
End If

Get and Set Context (ZMQ Wrapper)

#Include "../../Core/Enums.bi"
#Include "../../Core/ZeroMQWrapper.bi"

Dim lpszLibZmqDll As String = "libzmq.dll"

Dim hLibrary As Any Ptr = ZmqDllOpen(lpszLibZmqDll)

If hLibrary > 0 Then
    Dim Context As Any Ptr = ZmqContextRec.NewCtx()

    Print("Context: " & ZmqContextRec.Get(hLibrary, Context, ZMQ_MAX_SOCKETS))

    ZmqContextRec.Shutdown(Context)
    LibZMQWrapper.DllClose()
End If

Clone this wiki locally