Package ch.bailu.gtk.gio
Klasse ThreadedSocketService
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gio.SocketListener
ch.bailu.gtk.gio.SocketService
ch.bailu.gtk.gio.ThreadedSocketService
- Alle implementierten Schnittstellen:
PointerInterface
A `GThreadedSocketService` is a simple subclass of [class@Gio.SocketService]
that handles incoming connections by creating a worker thread and
dispatching the connection to it by emitting the
[signal@Gio.ThreadedSocketService::run signal] in the new thread.
The signal handler may perform blocking I/O 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 [class@Gio.SocketService] from accepting
new connections when all threads are busy.
As with [class@Gio.SocketService], you may connect to
[signal@Gio.ThreadedSocketService::run], or subclass and override the default
handler.
that handles incoming connections by creating a worker thread and
dispatching the connection to it by emitting the
[signal@Gio.ThreadedSocketService::run signal] in the new thread.
The signal handler may perform blocking I/O 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 [class@Gio.SocketService] from accepting
new connections when all threads are busy.
As with [class@Gio.SocketService], you may connect to
[signal@Gio.ThreadedSocketService::run], or subclass and override the default
handler.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gio.SocketService
SocketService.OnIncoming
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gio.SocketListener
SocketListener.OnAsyncReadyCallback, SocketListener.OnEvent
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gio.SocketService
SIGNAL_ON_INCOMING
Von Klasse geerbte Felder ch.bailu.gtk.gio.SocketListener
SIGNAL_ON_EVENT
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungThreadedSocketService
(int max_threads) Creates a new #GThreadedSocketService with no listeners.ThreadedSocketService
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
onRun
(ThreadedSocketService.OnRun signal) Connect to signal "run".Von Klasse geerbte Methoden ch.bailu.gtk.gio.SocketService
isActive, onIncoming, start, stop
Von Klasse geerbte Methoden ch.bailu.gtk.gio.SocketListener
acceptAsync, acceptSocketAsync, addAnyInetPort, addInetPort, addSocket, close, onEvent, setBacklog
Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
Konstruktordetails
-
ThreadedSocketService
-
ThreadedSocketService
public ThreadedSocketService(int max_threads) Creates a new #GThreadedSocketService with no listeners. Listeners
must be added with one of the #GSocketListener "add" methods.- Parameter:
max_threads
- the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
-
-
Methodendetails
-
getClassHandler
-
onRun
Connect to signal "run".
SeeThreadedSocketService.OnRun.onRun(ch.bailu.gtk.gio.SocketConnection, ch.bailu.gtk.gobject.Object)
for signal description.
FieldSIGNAL_ON_RUN
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-