+ std::for_each(m_conns.begin(), m_conns.end(), RemoveConn());
+}
+
+int CONFIGPROTO::Prepare()
+{
+ sigset_t sigmask, oldmask;
+ sigemptyset(&sigmask);
+ sigaddset(&sigmask, SIGINT);
+ sigaddset(&sigmask, SIGTERM);
+ sigaddset(&sigmask, SIGUSR1);
+ sigaddset(&sigmask, SIGHUP);
+ pthread_sigmask(SIG_BLOCK, &sigmask, &oldmask);
+
+ m_listenSocket = socket(PF_INET, SOCK_STREAM, 0);
+
+ if (m_listenSocket < 0)
+ {
+ m_errorStr = std::string("Cannot create listen socket: '") + strerror(errno) + "'.";
+ m_logger(m_errorStr);
+ return -1;
+ }