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


Public Member Functions | |
| ListenSocketBase (InspIRCd *Instance, int port, const std::string &addr) | |
| Create a new listening socket. | |
| void | HandleEvent (EventType et, int errornum=0) |
| Handle an I/O event. | |
| ~ListenSocketBase () | |
| 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. | |
| void | AcceptInternal () |
| Handles sockets internals crap of a connection, convenience wrapper really. | |
| virtual void | OnAcceptReady (const std::string &ipconnectedto, int fd, const std::string &incomingip)=0 |
| Called when a new connection has successfully been accepted on this listener. | |
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. |
|
|
Handles sockets internals crap of a connection, convenience wrapper really.
Definition at line 74 of file listensocket.cpp. References SocketEngine::Accept(), client, SocketEngine::Close(), DEBUG, SocketEngine::GetMaxFds(), SocketEngine::GetSockName(), LogManager::Log(), InspIRCd::Logs, MAXBUF, SocketEngine::NonBlocking(), OnAcceptReady(), raddr, InspIRCd::SE, ServerInstance, SocketEngine::Shutdown(), sock_us, InspIRCd::stats, serverstats::statsAccept, and serverstats::statsRefused. Referenced by HandleEvent(). |
|
|
Get description for socket.
|
|
|
Get IP address socket is bound to.
|
|
|
Get port number for socket.
Reimplemented in MsSQLListener, MySQLListener, and SQLiteListener. |
|
||||||||||||
|
Handle an I/O event.
Implements EventHandler. Definition at line 180 of file listensocket.cpp. References AcceptInternal(), DEBUG, DEFAULT, EVENT_ERROR, EVENT_READ, EVENT_WRITE, LogManager::Log(), InspIRCd::Logs, and ServerInstance. |
|
||||||||||||||||
|
Called when a new connection has successfully been accepted on this listener.
Implemented in HttpListener, MsSQLListener, MySQLListener, SQLiteListener, ServerSocketListener, and ClientListenSocket. Referenced by AcceptInternal(). |
|
|
Set descriptive text.
|
|
|
Address socket is bound to.
|
|
|
Port socket is bound to.
Definition at line 161 of file socket.h. Referenced by ServerSocketListener::OnAcceptReady(), and ClientListenSocket::OnAcceptReady(). |
|
|
Definition at line 165 of file socket.h. Referenced by AcceptInternal(), ListenSocketBase(), ClientListenSocket::OnAcceptReady(), and ~ListenSocketBase(). |
|
|
Socket description (shown in stats p).
|
|
|
Socket address family.
Definition at line 157 of file socket.h. Referenced by ListenSocketBase(). |
|
|
Definition at line 167 of file socket.h. Referenced by AcceptInternal(), ListenSocketBase(), and ~ListenSocketBase(). |
|
|
The creator/owner of this object.
Definition at line 153 of file socket.h. Referenced by AcceptInternal(), HandleEvent(), ListenSocketBase(), ServerSocketListener::OnAcceptReady(), HttpListener::OnAcceptReady(), ClientListenSocket::OnAcceptReady(), and ~ListenSocketBase(). |
|
|
Reimplemented in MsSQLListener, MySQLListener, and SQLiteListener. Definition at line 163 of file socket.h. Referenced by AcceptInternal(), ListenSocketBase(), and ~ListenSocketBase(). |
|
|
Definition at line 169 of file socket.h. Referenced by ListenSocketBase(), and ~ListenSocketBase(). |