openigtlink / OpenIGTLink

Free, open-source network communication library for image-guided therapy
http://openigtlink.org
BSD 3-Clause "New" or "Revised" License
102 stars 184 forks source link

A problem that a OpenIGTLink sever communicate with 3D Slicer client #238

Closed Natsu-666 closed 3 years ago

Natsu-666 commented 3 years ago
  Hi! I am trying to build a OpenIGTLink server based on Qt platform. It has two servers running on two threads respectively. The receiver server is used to receive image data from a software, and the sender server used to send the received image data to 3D  Slicer.      
  The first problem is that, when my Qt server receive and send image data through the same server, it did. But when i receive the image data through receiver server, and send the data through sender server, the function

int s = senderSocket->Send(ImgMsg->GetPackPointer(), ImgMsg->GetPackSize()); which return 1, but there is not image data in 3D Slicer client. The second problem is that when I run the code in Qt release mode, the compiler report the error "HEAP[transfer_station.exe]: Heap block at 000001E22B9A3F10 modified at 000001E22B9A4034 past requested size of 114". I use Visual Leak Detector to check, and the result print "WARNING: Visual Leak Detector detected memory leaks! ---------- Block 2 at 0x000000005965FF00: 159 bytes ---------- Leak Hash: 0xC66716A5, Count: 1, Total 159 bytes Call Stack (TID 25380): ucrtbase.dll!malloc_base() transfer_station.exe!igtl::Strnlen() + 0x3AA5 bytes transfer_station.exe!igtl::HeaderOnlyMessageBase::CalculateContentBufferSize() + 0x2A2 bytes transfer_station.exe!igtl::Strnlen() + 0x4166 bytes KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes ntdll.dll!RtlUserThreadStart() + 0x21 bytes" I dont know how to fix it. Could anyone help me? Thanks!