Skip to content

fix(io): disconnection is not handled properly in igtl::INetwork

Description

  1. Throw exceptions when igtl connections fails (timeout, network error, or mismatch in message size) instead of using nullptr.
  2. Create unit test to connect server and client & test sending messages.
  3. Add patched method for creating an igtlServer and closing connection to "resolve" bug from Debian old version of IGTL.
  • include patched header of igtlSocket.h (sight::io::igtl::patch::igtlSocket.h) to get public access to socket descriptor
  • use the descriptor in a patched version of closeSocket() to call close() after the shutdown() on linux
  • create patched version of createServer() (and thus BindSocket() listenSocket()) to get rid of the VTK_HAVE_SO_REUSEADDR define to add SO_REUSEADDR option in socket

Closes #874 (closed)

How to test it?

  1. io_igtlTest
  2. ExIgtl x2 (one client, one server) Try this before and after this MR you will quickly see the issue.

Some results

A better error handling, server can reuse the same port after closing.

Edited by Marc SCHWEITZER

Merge request reports

Loading