Drew,

Thanks for the info.  Actually, I was toying around with the SocketConnect VPE module tonight, and actually found an OpenDX listserv message back from 2000 where the developer mentioned how he utilized this shared memory buffer.  So (by coincidence) I was planning to look at that myself too; thanks for the tip!

Per some previous correspondence, I was debating on whether I should use this socket interface where DX Objects are streamed to the socket, or just send my raw data (much more compactly) from my application to DX (using my own socket interface), and then formulate the DX Objects in the DX-side module.  This may be more efficient in terms of socket throughput.  But even so, I may still try this socketconnect interface because it would be quicker to use (since it's already written.) - seems easy enough.

Thanks again for your help,

Matt
University of Texas at Austin
(formerly from Owego, NY though - your neck of the woods, Drew)
--


Andrew J. Dolgert wrote:
Re: [opendx-users] Usage model for OpenDX
Hi Matt,
 
I like your approach and Mike's suggestions.  His way of embedding OpenDX sounds very nice.
 
As to whether you can use the Image viewer from C calls, I'm not sure, either, because I've never tried running a network through C calls.  I recall Pelkie explaining to me that the Image module has a bunch of stuff in it that wraps other modules like Display and Camera, and I think Image is unduly intimate with the GUI, so it makes sense it might not be available as such, but Mike seems to have a workaround.
 
There is a module in the VPE called socketconnect.  I looked and couldn't find it while trying to answer your last message.  Glad you found it.  It isn't implemented on my dear Windows version, but I looked at the code, and it has a flippin' sweet protocol: 1. integer length of buffer to send 2. the buffer.  Then you close the socket.  Internally, it treats that buffer as a serialized version of a DX Object and deserializes it.  On your client, that means you need to take your data, create a DX Object, and then turn that Object into a string.  The command you will use to serialize is
 
Object _dxfExportBin_Buffer(Object o, int* size, void **buffer);
 
It returns NULL on error and your input o on success.  I'm telling you about this command b/c I don't recall seeing it in the docs even though it is exported from one of the libs.
 
If you want to implement a shared memory copy, you can start from socketconnect.c.
 
Drew
 

Reply via email to