|
Zappy Server
C++ game server: world, rules, scheduler, network
|
The server's listening socket. More...
#include <Listener.hpp>
Collaboration diagram for Listener:Public Member Functions | |
| Listener (int port) | |
Bind and listen on port. | |
| ~Listener () | |
| int | fd () const |
| The listening socket fd (to register in poll()). | |
| int | accept () const |
| Accept one pending client; returns its new socket fd. | |
| Listener (const Listener &)=delete | |
| Listener & | operator= (const Listener &)=delete |
Private Attributes | |
| int | _fd |
The server's listening socket.
Binds and listens on a port in the constructor (throws on failure), closes on destruction. Its fd is polled with the client sockets; when it's readable a new client is waiting and accept() pulls it in. Non-copyable.
Definition at line 31 of file Listener.hpp.
|
explicit |
Bind and listen on port.
| ListenerException | on failure. |
Definition at line 11 of file Listener.cpp.
References _fd.
| Listener::~Listener | ( | ) |
Definition at line 38 of file Listener.cpp.
References _fd.
|
delete |
| int Listener::accept | ( | ) | const |
Accept one pending client; returns its new socket fd.
Definition at line 45 of file Listener.cpp.
References _fd.
Referenced by ClientManager::_acceptNew().
Here is the caller graph for this function:| int Listener::fd | ( | ) | const |
The listening socket fd (to register in poll()).
Definition at line 43 of file Listener.cpp.
References _fd.
Referenced by ClientManager::_rebuildPollFds().
Here is the caller graph for this function:
|
private |
Definition at line 46 of file Listener.hpp.
Referenced by accept(), fd(), Listener(), and ~Listener().