30 #include <boost/intrusive/link_mode.hpp> 31 #include <boost/intrusive/list_hook.hpp> 49 public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>> {
110 bool Write(
const void *data,
size_t length);
115 bool Write(
const char *data);
201 virtual
InputResult OnSocketInput(
void *data,
size_t length) override;
202 void OnSocketError(std::exception_ptr ep) override;
203 virtual
void OnSocketClosed() override;
206 virtual
void OnTimeout() override;
SubscribeResult Subscribe(const char *channel)
gcc_pure const Storage * GetStorage() const noexcept
struct PlayerControl & player_control
unsigned idle_flags
idle flags pending on this client, to be sent as soon as the client enters "idle" ...
std::list< ClientMessage > messages
A list of messages this client has received.
This class monitors a timeout.
An OO wrapper for struct sockaddr.
Client(EventLoop &loop, Partition &partition, int fd, int uid, int num)
unsigned GetPermission() const
gcc_pure bool IsSubscribed(const char *channel_name) const noexcept
bool Unsubscribe(const char *channel)
An event loop that polls for events on file/socket descriptors.
const Database & GetDatabaseOrThrow() const
Wrapper for Instance::GetDatabaseOrThrow().
bool IsLocal() const
Is this client running on the same machine, connected with a local (UNIX domain) socket?
A partition of the Music Player Daemon.
void IdleAdd(unsigned flags)
gcc_printf(2, 3) void client_printf(Client &client
Write a printf-like formatted string to the client.
void SetPermission(unsigned _permission)
CommandListBuilder cmd_list
void client_vprintf(Client &client, const char *fmt, va_list args)
Write a printf-like formatted string to the client.
gcc_pure const Database * GetDatabase() const noexcept
Wrapper for Instance::GetDatabase().
void client_manager_init()
unsigned idle_subscriptions
idle flags that the client wants to receive
void client_new(EventLoop &loop, Partition &partition, int fd, SocketAddress address, int uid)
A client-to-client message.
A path name in the native file system character set.
void AllowFile(Path path_fs) const
Is this client allowed to use the specified local file?
unsigned num_subscriptions
The number of subscriptions in subscriptions.
already subscribed to this channel
void client_puts(Client &client, const char *s)
Write a C string to the client.
bool Write(const void *data, size_t length)
std::set< std::string > subscriptions
A list of channel names this client is subscribed to.
bool PushMessage(const ClientMessage &msg)
gcc_pure bool IsExpired() const noexcept
struct playlist & playlist
A BufferedSocket specialization that adds an output buffer.
int GetUID() const
returns the uid of the client process, or a negative value if the uid is unknown
int uid
the uid of the client process, or -1 if unknown
bool IdleWait(unsigned flags)
bool idle_waiting
is this client waiting for an "idle" response?
void IdleNotify()
Send "idle" response to this client.