glibmm: Gio::SocketSource Class Reference

glibmm 2.84.0

Public Types | Static Public Member Functions | Protected Member Functions | List of all members
Gio::SocketSource Class Reference
Portable Network I/O Functionality

An event source that can monitor a Gio::Socket. More...

`#include <giomm/socketsource.h>`

Inheritance diagram for Gio::SocketSource:
[legend]

## Public Types
using | CppObjectType = Gio::SocketSource
Public Types inherited from Glib::IOSource
using | CppObjectType = Glib::IOSource
Public Types inherited from Glib::Source
using | CppObjectType = Glib::Source
using | BaseObjectType = GSource

## Static Public Member Functions
static Glib::RefPtr< SocketSource > | create (const Glib::RefPtr< Socket > &socket, Glib::IOCondition condition, const Glib::RefPtr< Cancellable > & cancellable={})
Static Public Member Functions inherited from Glib::IOSource
static Glib::RefPtr< IOSource > | create (PollFD::fd_t fd, IOCondition condition)
static Glib::RefPtr< IOSource > | create (const Glib::RefPtr< IOChannel > & channel, IOCondition condition)
Static Public Member Functions inherited from Glib::Source
static Glib::RefPtr< Source > | create ()

## Protected Member Functions
| SocketSource (const Glib::RefPtr< Socket > &socket, Glib::IOCondition condition, const Glib::RefPtr< Cancellable > & cancellable)
| ~SocketSource () noexcept override
Protected Member Functions inherited from Glib::IOSource
| IOSource (PollFD::fd_t fd, IOCondition condition)
| IOSource (const Glib::RefPtr< IOChannel > & channel, IOCondition condition)
| IOSource (GSource * cast_item, GSourceFunc callback_func)
| Wrap an existing GSource object and install the given callback function.
| ~IOSource () noexcept override
bool | prepare (int &timeout) override
bool | check () override
bool | dispatch (sigc::slot_base * slot) override
Protected Member Functions inherited from Glib::Source
| Source ()
| Construct an object that uses the virtual functions prepare(), check() and dispatch().
| Source (GSource * cast_item, GSourceFunc callback_func)
| Wrap an existing GSource object and install the given callback function.
virtual | ~Source () noexcept
sigc::connection | connect_generic (const sigc::slot_base & slot)
void | add_poll (PollFD & poll_fd)
| Adds a file descriptor to the set of file descriptors polled for this source.
void | remove_poll (PollFD & poll_fd)
| Removes a file descriptor from the set of file descriptors polled for this source.
gint64 | get_time () const
| Gets the time to be used when checking this source.

## Additional Inherited Members
Public Member Functions inherited from Glib::IOSource
sigc::connection | connect (const sigc::slot< bool(IOCondition)> & slot)
Public Member Functions inherited from Glib::Source
| Source (const Source &)=delete
Source & | operator= (const Source &)=delete
unsigned int | attach (const Glib::RefPtr< MainContext > & context)
| Adds a Source to a context so that it will be executed within that context.
unsigned int | attach ()
| Adds a Source to a context so that it will be executed within that context.
void | destroy ()
| Removes a source from its MainContext, if any, and marks it as destroyed.
void | set_priority (int priority)
| Sets the priority of a source.
int | get_priority () const
| Gets the priority of a source.
void | set_can_recurse (bool can_recurse)
| Sets whether a source can be called recursively.
bool | get_can_recurse () const
| Checks whether a source is allowed to be called recursively.
unsigned int | get_id () const
| Returns the numeric ID for a particular source.
Glib::RefPtr< MainContext > | get_context ()
| Gets the MainContext with which the source is associated.
GSource * | gobj ()
const GSource * | gobj () const
GSource * | gobj_copy () const
void | reference () const
void | unreference () const

## Detailed Description

An event source that can monitor a Gio::Socket.

See also
  Gio::Socket::create_source().

Since glibmm 2.42

## Member Typedef Documentation

## ◆ CppObjectType

using Gio::SocketSource::CppObjectType = Gio::SocketSource

## Constructor & Destructor Documentation

## ◆ SocketSource()

Gio::SocketSource::SocketSource | ( | const Glib::RefPtr< Socket > & | socket,
|  | Glib::IOCondition | condition,
|  | const Glib::RefPtr< Cancellable > & | cancellable )
| protected

## ◆ ~SocketSource()

Gio::SocketSource::~SocketSource | ( |  | ) |
| overrideprotectednoexcept

## Member Function Documentation

## ◆ create()

static Glib::RefPtr< SocketSource > Gio::SocketSource::create | ( | const Glib::RefPtr< Socket > & | socket,
|  | Glib::IOCondition | condition,
|  | const Glib::RefPtr< Cancellable > & | cancellable = {} )
| static