[vtkusers] using vtkSocketCommunicator for server application
markus at noodle.med.yale.edu
markus at noodle.med.yale.edu
Sun Nov 10 18:33:32 EST 2002
Hello dear VTK users !
I've got some questions concerning the "vtkSocketCommunicator" class.
I am using this class to build a kind of server. You can request
several different VTK objects and you can send some objects to the server.
I am aware of the fact, that this kind of usage is not what this class was
written for.
As stability is important to my server application, I have
modified the "vtkSocketCommunicator" (mainly to handle cases like
connection abortions, non-responding clients, ...). The main modification is
a change to a "non-blocking socket/select()" approach. For this, I added
replacement functions for "send()" and "recv()" and changed the existing
methods to use my replacements. These functions also handle 0 as a
return value of send/recv (I had several "hangups" of my server because of
looping over calls returning 0) and they should deal with interrupted calls
(EINTR on UNIX). In addition, they split up large input-data into several
calls to recv/send (as I got error-messages about missing buffer space in
the network layer). As I am running the "VTK" server part in a thread,
I have added a method to be able to abort any operation (to be called
by a controlling thread) that would be blocking in the original class.
So far, the class should be compatible to the original class (protocol
is the same, so a client should be able to use the original class).
Are there any chances to integrate this into the VTK distribution
some day when the code is tested and cleaned up ?
If this is not the case, I would not spend to much time in making the code
portable to every platform supported by VTK as I only use it on Windows
(I have code there for Windows and general Unix, but I only have
access to Linux to test the Unix parts).
The second question: if it could be added to VTK, should it be
completely compatible to the original class ?. If this is not
necessary, one could integrate things like mutual authentication and
session encryption.
By the way: if you use the vtkSocketCommunicator in a more VTK like
style (together with "vtkInput/OutputPort"), is it possible to "break up"
very big data objects and transfer them "step by step" ? Could you use
"vtkImageDataStreamer" for this ? Could anyone provide some
examples of this ?
Any comments or suggestions are highly appreciated !!
Thanks in advance,
Markus
---------------------------------------------
This message was sent using Endymion MailMan.
http://www.endymion.com/products/mailman/
More information about the vtkusers
mailing list