FACT++  1.0
void READ_STRUCT::destroy ( )

Definition at line 343 of file EventBuilder.cc.

References factPrintf(), MessageImp::kError, MessageImp::kFatal, and MessageImp::kInfo.

344 {
345  if (socket<0)
346  return;
347 
348 #ifdef USE_EPOLL
349  // strictly speaking this should not be necessary
350  if (fd_epoll>=0 && connected && epoll_ctl(fd_epoll, EPOLL_CTL_DEL, socket, NULL)<0)
351  factPrintf(MessageImp::kError, "epoll_ctrl failed: %m (EPOLL_CTL_DEL,rc=%d)", errno);
352 #endif
353 
354  if (::close(socket) > 0)
355  factPrintf(MessageImp::kFatal, "Closing socket %d failed: %m (close,rc=%d)", sockId, errno);
356  else
357  factPrintf(MessageImp::kInfo, "Closed socket %d (%d)", sockId, socket);
358 
359  // Set the socket to "not connected"
360  socket = -1;
361  connected = false;
362  activeSockets--;
363  bufLen = 0;
364 }
void factPrintf(int severity, const char *fmt,...)
uint32_t bufLen
An info telling something which can be interesting to know.
Definition: MessageImp.h:17
static uint activeSockets
static void close()
Error, something unexpected happened, but can still be handled by the program.
Definition: MessageImp.h:19
static int fd_epoll
An error which cannot be handled at all happend, the only solution is program termination.
Definition: MessageImp.h:21

+ Here is the call graph for this function: