|
|||
|
|||
|
#include <socket.h>
Inheritance diagram for ListenSocket:


Public Member Functions | |
| ListenSocket (InspIRCd *Instance, int port, char *addr) | |
| Create a new listening socket. | |
| void | HandleEvent (EventType et, int errornum=0) |
| Handle an I/O event. | |
| ~ListenSocket () | |
| Close the socket. | |
| void | SetDescription (const std::string &description) |
| Set descriptive text. | |
| const std::string & | GetDescription () |
| Get description for socket. | |
| int | GetPort () |
| Get port number for socket. | |
| std::string & | GetIP () |
| Get IP address socket is bound to. | |
Protected Attributes | |
| InspIRCd * | ServerInstance |
| The creator/owner of this object. | |
| std::string | desc |
| Socket description (shown in stats p). | |
| int | family |
| Socket address family. | |
| std::string | bind_addr |
| Address socket is bound to. | |
| int | bind_port |
| Port socket is bound to. | |
Static Protected Attributes | |
| static sockaddr * | sock_us = NULL |
| static sockaddr * | client = NULL |
| static sockaddr * | raddr = NULL |
| static unsigned int | socketcount = 0 |
It will create a new User for every valid connection and assign it a file descriptor.
Definition at line 148 of file socket.h.
|
||||||||||||||||
|
Create a new listening socket.
Definition at line 27 of file listensocket.cpp. References SocketEngine::AddFd(), InspIRCd::BindSocket(), client, DEBUG, family, EventHandler::fd, LogManager::Log(), InspIRCd::Logs, irc::sockets::OpenTCPSocket(), raddr, InspIRCd::SE, ServerInstance, EventHandler::SetFd(), sock_us, and socketcount. |
|
|
Close the socket.
Definition at line 54 of file listensocket.cpp. References client, SocketEngine::Close(), DEBUG, SocketEngine::DelFd(), EventHandler::fd, LogManager::Log(), InspIRCd::Logs, raddr, InspIRCd::SE, ServerInstance, SocketEngine::Shutdown(), sock_us, and socketcount. |
|
|
Get description for socket.
|
|
|
Get IP address socket is bound to.
|
|
|
Get port number for socket.
|
|
||||||||||||
|
Handle an I/O event.
Implements EventHandler. Definition at line 73 of file listensocket.cpp. References SocketEngine::Accept(), UserManager::AddUser(), client, SocketEngine::Close(), DEBUG, DEFAULT, EVENT_ERROR, EVENT_READ, EVENT_WRITE, SocketEngine::GetSockName(), LogManager::Log(), InspIRCd::Logs, MAXBUF, SocketEngine::NonBlocking(), raddr, InspIRCd::SE, ServerInstance, SocketEngine::Shutdown(), sock_us, InspIRCd::stats, serverstats::statsAccept, serverstats::statsRefused, and InspIRCd::Users. |
|
|
Set descriptive text.
|
|
|
Address socket is bound to.
|
|
|
Port socket is bound to.
|
|
|
Definition at line 165 of file socket.h. Referenced by HandleEvent(), ListenSocket(), and ~ListenSocket(). |
|
|
Socket description (shown in stats p).
|
|
|
Socket address family.
Definition at line 157 of file socket.h. Referenced by ListenSocket(). |
|
|
Definition at line 167 of file socket.h. Referenced by HandleEvent(), ListenSocket(), and ~ListenSocket(). |
|
|
The creator/owner of this object.
Definition at line 153 of file socket.h. Referenced by HandleEvent(), ListenSocket(), and ~ListenSocket(). |
|
|
Definition at line 163 of file socket.h. Referenced by HandleEvent(), ListenSocket(), and ~ListenSocket(). |
|
|
Definition at line 169 of file socket.h. Referenced by ListenSocket(), and ~ListenSocket(). |