<div dir="ltr">Hi,<div><br></div><div>I tested on Linux (Ubuntu 16.04). </div><div><br></div><div>Best,</div><div>Andy</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 11, 2017 at 1:58 PM,  <span dir="ltr"><<a href="mailto:klarmann@mechanik.tu-darmstadt.de" target="_blank">klarmann@mechanik.tu-darmstadt.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Andy,<br>
<br>
I just tried my example on arch linux and it works as expected. (ParaView 5.4.0-RC1)<br>
<br>
Somehow I got the feeling it is an issue related to Windows. Just to be sure, which OS did you choose to test the example code?<br>
<br>
Thank you very much for your time and support,<br>
Simon<div><div class="h5"><br>
<br>
<br>
<br>
Am 2017-07-11 17:02, schrieb Andy Bauer:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi Simon,<br>
<br>
I tried with PV master (84f6e514) and couldn't replicate the crash. I<br>
was able to get the connection between the GUI and the CatalystTest<br>
executable though since I saw the PVTrivialProducer come up in the<br>
GUI.<br>
<br>
Maybe you could try PV master and see if it works for you. Beyond that<br>
I think figuring out your issue would take a non-trivial amount of<br>
effort to figure out.<br>
<br>
Cheers,<br>
Andy<br>
<br>
On Tue, Jul 11, 2017 at 8:04 AM, Simon Klarmann<br>
<<a href="mailto:klarmann@mechanik.tu-darmstadt.de" target="_blank">klarmann@mechanik.tu-darmstad<wbr>t.de</a>> wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi Andy,<br>
<br>
I want to be able to close the connection from both sides. Closing<br>
the connection from the Insitu side works by calling<br>
vtkLiveInsituLink::DropLiveIns<wbr>ituConnection().<br>
<br>
Closing the connection from the Live side, e.g. by closing the GUI,<br>
causes my application to hang in the vtkSocket::Receive() method.<br>
<br>
After enabling the Debug mode I get the following Error on the<br>
Insitu side:<br>
<br>
“ERROR: In<br>
D:\build\ParaView-v5.4.0\VTK\C<wbr>ommon\System\vtkSocket.cxx, line 572<br>
<br>
vtkClientSocket (0000000008BFFC00): Socket error in call to send.<br>
Eine bestehende Verbindung wurde softwaregesteuert durch den<br>
Hostcomputer abgebrochen.”<br>
<br>
„Eine bestehende Verbindung wurde softwaregesteuert durch den<br>
Hostcomputer abgebrochen“<br>
<br>
This seems to be a windows specific message notifying about a<br>
software controlled termination of the connection. So the<br>
information of the termination of the connection is somewhere<br>
available. The method throwing this error is the vtkSocket::Send()<br>
method.<br>
<br>
This error shows up as soon as I close the connection from the Live<br>
side (GUI) and then perform an InsituUpdate on the Insitu side.<br>
Still after this message, my Insitu side runs into<br>
vtkSocket::Receive() and get stuck there, trying to receive data.<br>
<br>
Additional Info:<br>
<br>
Performing the live visualization with the vtkCPPythonAdapter leads<br>
to the same error message and a crash of the Insitu application.<br>
<br>
Attached is a minimalistic working example. In both cases the error<br>
happens.<br>
<br>
Steps to reproduce:<br>
<br>
1.       Start Paraview ->Catalyst->Connect<br>
<br>
2.       Start the application, choose either 0 for python or 1 for<br>
cpp, then the PVTrivialproducer should show up in Paraview<br>
<br>
3.       Close Paraview<br>
<br>
4.       Continue the application ->crash<br>
<br>
I hope this helps a little bit to get an insight on what I did.<br>
<br>
Thanks,<br>
<br>
Simon<br>
<br></div></div>
VON: Andy Bauer [mailto:<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a> [1]]<br>
GESENDET: Montag, 10. Juli 2017 22:21<br>
<br>
AN: Simon Klarmann<br>
CC: <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a><br>
BETREFF: Re: [Paraview] C++ Catalyst vtkSocket::Receive stuck in<div><div class="h5"><br>
loop on Windows<br>
<br>
Hi,<br>
<br>
Are you trying to close the connection from the in situ side? The<br>
design was for the connection to be close through the GUI.<br>
<br>
It's difficult to say what exactly is going on here without getting<br>
fairly deep into the problem. Theoretically though it should be<br>
possible to do the Live link in C++ as most of the Python routines<br>
call wrapped C++ routines.<br>
<br>
There should be some way to figure out the status of the connection<br>
on the PV server (the builtin server if you're not connected to a<br>
separate pvserver process) either the NotifyClientDisconnected()<br>
method, or vtkLiveInsituLink::OnConnectio<wbr>nClosedEvent() or<br>
vtkLiveInsituLink::DropLiveIns<wbr>ituConnection() member functions.<br>
<br>
Cheers,<br>
<br>
Andy<br>
<br>
On Mon, Jul 10, 2017 at 10:34 AM, Simon Klarmann<br>
<<a href="mailto:klarmann@mechanik.tu-darmstadt.de" target="_blank">klarmann@mechanik.tu-darmstad<wbr>t.de</a>> wrote:<br>
<br>
Sorry I think I have chosen the wrong reply method.<br>
<br>
Hi Andy,<br>
<br>
I already got rid of Python on both sides. CoProcessing with Live<br>
connection is working by directly using the vtkLiveInsituLink (pure<br>
C++ implementation).<br>
<br>
Working with both Paraview 5.2  and 5.4.<br>
<br>
My problem is closing the connection on the Live side (e.g. closing<br>
Paraview). Doing so, my Insitu side hangs (when trying again to send<br>
data, m_link->InsituUpdate, see below) in the receive method of the<br>
vtkSocket class until at some point an integer underflow happens.<br>
<br>
Closing the connection from the Insitu side everything works as<br>
expected.<br>
<br>
Are there any methods to directly check if the connection is still<br>
alive?<br>
<br>
Or is it a Windows specific problem?<br>
<br>
Additionally the steps for the live connection in C++, for sure<br>
there may be more elegant ways:<br>
<br>
// Initialization<br>
<br>
vtkCPProcessor  *m_proc = vtkCPProcessor::New();<br>
<br>
m_proc->Initialize();<br>
<br>
vtkLiveInsituLink  *m_link =<br>
vtkLiveInsituLink::New();<br>
<br>
m_link->SetInsituPort(22222);<br>
<br>
m_link->SetHostname("localhost<wbr>");<br>
<br>
m_link->SetProcessType(vtkLive<wbr>InsituLink::INSITU);<br>
<br>
vtkSMProxyManager  *m_spxm =<br>
<br>
</div></div></blockquote>
vtkSMProxyManager::GetProxyMan<wbr>ager()->GetActiveSessionProxyM<wbr>anager();<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
vtkSMProxy *m_px = m_spxm->NewProxy("sources",<br>
"PVTrivialProducer");<br>
<br>
vtkSMSourceProxy *m_spx =<br>
vtkSMSourceProxy::SafeDownCast<wbr>(m_px);<br>
<br>
m_spxm->RegisterProxy("sources<wbr>", m_spx);<br>
<br>
vtkObjectBase *obase = m_spx->GetClientSideObject();<br>
<br>
vtkPVTrivialProducer *prod =<br>
<br>
<br>
vtkPVTrivialProducer::SafeDown<wbr>Cast(obase);<br>
<br>
prod->SetOutput(m_toplot, m_time);    // m_toplot is<br>
a vtkMultiBlockDataSet<br>
<br>
m_link->Initialize(m_spxm);<br>
<br>
//Update the live side<br>
<br>
m_link->InsituUpdate(m_time, m_tstep);<br>
<br>
m_spx->UpdatePipeline(m_time);<br>
<br>
m_link->InsituPostProcess(m_ti<wbr>me,m_tstep);<br>
<br>
Thanks,<br>
<br>
Simon<br>
<br></div></div>
VON: Andy Bauer [mailto:<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a><wbr>]<br>
GESENDET: Donnerstag, 6. Juli 2017 17:14<br>
AN: Simon Klarmann<br>
CC: <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a><br>
BETREFF: Re: [Paraview] C++ Catalyst vtkSocket::Receive stuck in<div><div class="h5"><br>
loop on Windows<br>
<br>
Hi Simon,<br>
<br>
Is the Python dependency that you're trying to get rid of on the<br>
Catalyst side or on the pvserver/GUI side? If I remember correctly<br>
on the Catalyst side Python was required for the Live connection.<br>
<br>
Cheers,<br>
<br>
Andy<br>
<br>
On Wed, Jul 5, 2017 at 10:11 AM, Simon Klarmann<br>
<<a href="mailto:klarmann@mechanik.tu-darmstadt.de" target="_blank">klarmann@mechanik.tu-darmstad<wbr>t.de</a>> wrote:<br>
<br>
Dear Members,<br>
<br>
I wanted to get rid of the dependency on Python. The connection by<br>
pure C++ works just fine.<br>
<br>
The problem occurs when establishing the live connection to<br>
Paraview, closing Paraview and then try to send some data again.<br>
<br>
I tracked it down to the vtkSocket class inside the method Receive.<br>
After the connection is terminated on the Paraview side, e.g. by<br>
closing Paraview, the call of vtkLiveInsituLink::InsituUpdat<wbr>e gets<br>
stuck in the vtkSocket::Receive method. Even though I get a message<br>
that the connection was terminated.<br>
<br>
A temporary fix for my case was to replace in Line 609 of the<br>
vtkSocket.cxx if (nRecvd == 0) with if (nRecvd <= 0), because on<br>
disconnection the return value of nRecvd is -1. Then everything<br>
works well.<br>
<br>
I only used the following methods in the given order to transfer the<br>
data:<br>
<br>
vtkLiveInsituLink::InsituUpdat<wbr>e<br>
<br>
vtkSMSourceProxy::UpdatePipeli<wbr>ne<br>
<br>
vtkLiveInsituLink::InsituPostP<wbr>rocess<br>
<br>
Are there further steps to perform or is there a way to check if the<br>
connection is still alive?<br>
<br>
Operating System: Windows 7, Visual Studio 2017<br>
<br>
Thanks,<br>
<br>
Simon<br>
<br>
Dipl.-Ing. Simon Klarmann<br>
<br></div></div>
BAU- UND UMWELTINGENIEURWISSENSCHAFTEN<span class=""><br>
Technische Universität Darmstadt<br>
<br>
Fachgebiet Festkörpermechanik<br>
<br></span>
Tel.: <a href="tel:%2B49%206151%2016" value="+49615116" target="_blank">+49 6151 16</a> – 22642 [2]<span class=""><br>
<br>
Mail: <a href="mailto:klarmann@mechanik.tu-darmstadt.de" target="_blank">klarmann@mechanik.tu-darmstadt<wbr>.de</a><br>
<br>
Franziska-Braun-Straße 7<br>
<br>
Gebäude L5|01, Raum 542<br>
<br>
64287 Darmstadt<br>
<br>
______________________________<wbr>_________________<br></span>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a> [3]<span class=""><br>
<br>
Visit other Kitware open-source projects at<br>
</span><a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a> [4]<span class=""><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at:<br>
</span><a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaV<wbr>iew</a> [5]<span class=""><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br></span>
[6]<span class=""><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</span><a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/paraview</a> [7]<br>
</blockquote>
<br>
<br>
<br>
Links:<br>
------<br>
[1] <a href="http://re.com" rel="noreferrer" target="_blank">http://re.com</a><br>
[2] tel:+49%206151%201622642<br>
[3] <a href="http://www.kitware.com" rel="noreferrer" target="_blank">http://www.kitware.com</a><br>
[4] <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
[5] <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaV<wbr>iew</a><br>
[6] <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br>
[7] <a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/paraview</a><br>
</blockquote>
</blockquote></div><br></div>