[vtkusers] Failed attempt connection between VTK and ZeroMQ
David Cole
DLRdave at aol.com
Thu Jul 23 08:59:04 EDT 2015
Really?
>From the code you attached:
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer( ren1 );
renWin->SetSize( 300, 300 );
// Send reply back to client
zmq::message_t reply;
memcpy((void *)reply.data(), renWin, 99999);
socket.send(reply);
Two questions back to you:
Why do you think a pointer to a vtkRenderWindow in one process may be
sent across a ZMQ socket to another process in this manner?
Why do you think the vtkRenderWindow points to 99999 bytes worth of memory?
I suggest studying up on how to serialize data for sending across a
socket from one process to another before you try to do it with VTK
objects.
To start with, search for "serializ" on this web page:
http://zeromq.org/area:faq and just google around for serializing
stuff for zeromq.
Also: http://stackoverflow.com/q/14480161/236192 (and there's a
section on the right with other related stack overflow questions...)
HTH,
David C.
On Thu, Jul 23, 2015 at 5:24 AM, Paolo Grossi <smoldino at gmail.com> wrote:
> Hi all,
> I'm trying to bind the ZeroMQ properties with the VTK visualisations
> possibility.
> Server/client are written in C++ language.
>
> The goal of the server is to receive a greet message from the server and to
> respond with the vtkRenderWindow.
>
> The goal of the client is to send an "Hello" message to the server and to
> receive a vtkRenderWindow in order to reproduce it.
>
> After the execution I obtain this output with the command "hwclient &
> hwserver":
>
> [S] Open connection
> [C] Connecting to server…
> [C] Sending Hello
> [S] Received Hello
> terminate called after throwing an instance of 'zmq::error_t'
> what(): Bad address
>
> I'm looking forward to hear you.
>
> Thanks,
> Paolo Grossi.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list