Package org.gnome.gio

Class SocketListener

java.lang.Object
All Implemented Interfaces:
Proxy
Direct Known Subclasses:
SocketService

@Generated("io.github.jwharm.JavaGI") public class SocketListener extends GObject
A GSocketListener is an object that keeps track of a set of server sockets and helps you accept sockets from any of the socket, either sync or async.

Add addresses and ports to listen on using addAddress(org.gnome.gio.SocketAddress, org.gnome.gio.SocketType, org.gnome.gio.SocketProtocol, org.gnome.gobject.GObject, io.github.jwharm.javagi.base.Out<org.gnome.gio.SocketAddress>) and addInetPort(short, org.gnome.gobject.GObject). These will be listened on until close() is called. Dropping your final reference to the GSocketListener will not cause close() to be called implicitly, as some references to the GSocketListener may be held internally.

If you want to implement a network server, also look at SocketService and ThreadedSocketService which are subclasses of GSocketListener that make this even easier.