dmNetRegisterPool, dmNetRegisterBuffer - register memory with dmNet
DMstatus dmNetRegisterPool(DMnetconnection, DMbufferpool);
dmNetRegisterPool and dmNetRegisterBuffer are the suite of dmNet memory
registration calls, relevant only to the receiver process. One of these
two calls must be made before a call to dmNetRecv is made, or dmNetRecv
will fail with ENOMEM.
dmNetRegisterPool allows an application to specify a buffer pool from
which dmNetRecv may allocate memory for incoming DMbuffers. The buffer
must be returned to the pool with a call to dmBufferFree after the
application is done with it, or dmNetRecv may fail with ENOMEM when no
buffers remain in the pool.
It is also possible to pre-allocate buffers for dmNetRecv to use, in
which case dmNetRegisterBuffer must be called. dmNetRegisterBuffer does
not register a particular buffer, but indicates to dmNet that the
DMbuffer reference passed to dmNetRecv is valid.
Each registration call has the effect of cancelling all previous
registrations, i.e, only the last invocation of
dmNetRegisterPool/dmNetRegisterBuffer will be remembered by dmNet.
This is a contrived example to illustrate how multiple memory
registration calls may be made. 3 buffers are received, the first into
pool1, and the others into pool2.
PPPPaaaaggggeeee 1111 [ Back ]