Skip to content

Context

Jiowcl edited this page May 20, 2021 · 7 revisions

Context

Get and Set Context

EnableExplicit

IncludeFile "../Core/ZeroMQ.pbi"

Global lpszLibZmqDll.s = "libzmq.dll"

Global hLibrary.i = ZmqDllOpen(lpszLibZmqDll)

If hLibrary
  Define Context.i = ZmqCtxNew(hLibrary)
  ZmqCtxSet(hLibrary, Context, #ZMQ_MAX_SOCKETS, 16)

  Debug ZmqCtxGet(hLibrary, Context, #ZMQ_MAX_SOCKETS)

  ZmqCtxShutdown(hLibrary, Context)
  ZmqDllClose(hLibrary)
EndIf

Get and Set Context (ZMQ Wrapper)

EnableExplicit

IncludeFile "../Core/Enums.pbi"
IncludeFile "../Core/ZeroMQWrapper.pbi"

UseModule ZeroMQWrapper

Global lpszLibZmqDll.s = "libzmq.dll"

If DllOpen(lpszLibZmqDll)
  Define Context.i = ZmqContext::New()
  ZmqContext::Set(Context, #ZMQ_MAX_SOCKETS, 16)

  Debug ZmqContext::Get(Context, #ZMQ_MAX_SOCKETS)

  ZmqContext::Shutdown(Context)
  DllClose()
EndIf

Clone this wiki locally