MCPcopy Create free account
hub / github.com/Kitware/VTK / Send

Method Send

Common/System/vtkSocket.cxx:548–583  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

546
547//------------------------------------------------------------------------------
548int vtkSocket::Send(const void* data, int length)
549{
550#ifndef VTK_SOCKET_FAKE_API
551 if (!this->GetConnected())
552 {
553 vtkErrorMacro("Not connected.");
554 return 0;
555 }
556 if (length == 0)
557 {
558 // nothing to send.
559 return 1;
560 }
561 const char* buffer = reinterpret_cast<const char*>(data);
562 int total = 0;
563 do
564 {
565 int flags = 0;
566 int nSent;
567 vtkRestartInterruptedSystemCallMacro(
568 send(this->SocketDescriptor, buffer + total, length - total, flags), nSent);
569 if (nSent == vtkSocketErrorReturnMacro)
570 {
571 vtkSocketErrorMacro(vtkErrnoMacro, "Socket error in call to send.");
572 return 0;
573 }
574 total += nSent;
575 } while (total < length);
576
577 return 1;
578#else
579 static_cast<void>(data);
580 static_cast<void>(length);
581 return 0;
582#endif
583}
584
585//------------------------------------------------------------------------------
586int vtkSocket::Receive(void* data, int length, int readFully /*=1*/)

Callers 15

create_amr_UGMethod · 0.45
load_variable_data_UGMethod · 0.45
SendGridMethod · 0.45
GetGridMethod · 0.45
InitializeGlobalMethod · 0.45
LoadVariableDataMethod · 0.45
RequestDataMethod · 0.45
SetIsoValueRMIFunction · 0.45
SetIsoValueRMIFunction · 0.45
SetIsoValueRMIFunction · 0.45

Calls 1

sendFunction · 0.50

Tested by 2

ExecuteMethod · 0.36
ExecuteMethod · 0.36