[]Struct gio::ThreadedSocketService

pub struct ThreadedSocketService(_, _);

A ThreadedSocketService is a simple subclass of SocketService that handles incoming connections by creating a worker thread and dispatching the connection to it by emitting the ThreadedSocketService::run signal in the new thread.

The signal handler may perform blocking IO and need not return until the connection is closed.

The service is implemented using a thread pool, so there is a limited amount of threads available to serve incoming requests. The service automatically stops the SocketService from accepting new connections when all threads are busy.

As with SocketService, you may connect to ThreadedSocketService::run, or subclass and override the default handler.

Implements

ThreadedSocketServiceExt, SocketServiceExt, SocketListenerExt, glib::object::ObjectExt, SocketListenerExtManual

Methods

impl ThreadedSocketService[src]

pub fn new(max_threads: i32) -> ThreadedSocketService[src]

Creates a new ThreadedSocketService with no listeners. Listeners must be added with one of the SocketListener "add" methods.

max_threads

the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit

Returns

a new SocketService.

Trait Implementations

impl Clone for ThreadedSocketService

impl Debug for ThreadedSocketService

impl Display for ThreadedSocketService[src]

impl Eq for ThreadedSocketService

impl Hash for ThreadedSocketService

impl IsA<SocketListener> for ThreadedSocketService

impl IsA<SocketService> for ThreadedSocketService

impl Ord for ThreadedSocketService

impl<T: ObjectType> PartialEq<T> for ThreadedSocketService

impl<T: ObjectType> PartialOrd<T> for ThreadedSocketService

impl StaticType for ThreadedSocketService

Auto Trait Implementations

impl RefUnwindSafe for ThreadedSocketService

impl !Send for ThreadedSocketService

impl !Sync for ThreadedSocketService

impl Unpin for ThreadedSocketService

impl UnwindSafe for ThreadedSocketService

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 
[src]

impl<T> Cast for T where
    T: ObjectType
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.