-
- /* Create a socket on a random port. Let the tcp stack allocate us an available port */
-#ifdef IPV6
- Notifier(InspIRCd* SI) : InspSocket(SI, "::1", 0, true, 3000)
-#else
- Notifier(InspIRCd* SI) : InspSocket(SI, "127.0.0.1", 0, true, 3000)
-#endif
- {
- uslen = sizeof(sock_us);
- if (getsockname(this->fd,(sockaddr*)&sock_us,&uslen))
- {
- throw ModuleException("Could not create random listening port on localhost");
- }
- }
-
- Notifier(InspIRCd* SI, int newfd, char* ip) : InspSocket(SI, newfd, ip)
- {
- Instance->Log(DEBUG,"Constructor of new socket");
- }
-
- /* Using getsockname and ntohs, we can determine which port number we were allocated */
- int GetPort()
- {
-#ifdef IPV6
- return ntohs(sock_us.sin6_port);
-#else
- return ntohs(sock_us.sin_port);
-#endif
- }
-
- virtual int OnIncomingConnection(int newsock, char* ip)
- {
- Instance->Log(DEBUG,"Inbound connection on fd %d!",newsock);
- Notifier* n = new Notifier(this->Instance, newsock, ip);
- n = n; /* Stop bitching at me, GCC */
- return true;
- }
+ Notifier(ModuleSQL* P, InspIRCd* SI, int newfd, char* ip) : BufferedSocket(SI, newfd, ip), Parent(P) { }