Logo Search packages:      
Sourcecode: sbnc version File versions  Download package

void CCore::RegisterSocket ( SOCKET  Socket,
CSocketEvents EventInterface 
)

RegisterSocket

Registers an event interface for a socket.

Parameters:
Socket the socket
EventInterface the event interface for the socket

Definition at line 861 of file Core.cpp.

References socket_s::Events, Fatal(), m_OtherSockets, socket_s::PollFd, and UnregisterSocket().

Referenced by CListenerBase< InheritedClass >::CListenerBase(), and CConnection::InitSocket().

                                                                       {
      socket_s SocketStruct;
      pollfd *PollFd = NULL;

      UnregisterSocket(Socket);

      PollFd = registersocket(Socket);

      if (PollFd == NULL) {
            LOGERROR("registersocket() failed.");

            Fatal();
      }

      SocketStruct.PollFd = PollFd;
      SocketStruct.Events = EventInterface;

      /* TODO: can we safely recover from this situation? return value maybe? */
      if (!m_OtherSockets.Insert(SocketStruct)) {
            LOGERROR("Insert() failed.");

            Fatal();
      }
}


Generated by  Doxygen 1.6.0   Back to index