listen


Description:

[ Version ( since = "2.48" ) ]
public bool listen (SocketAddress address, ServerListenOptions options) throws Error

This attempts to set up this to listen for connections on address.

If options includes HTTPS, and this has been configured for TLS, then this will listen for https connections on this port. Otherwise it will listen for plain http.

You may call this method (along with the other "listen" methods) any number of times on a server, if you want to listen on multiple ports, or set up both http and https service.

After calling this method, this will begin accepting and processing connections as soon as the appropriate MainContext is run.

Note that Server never makes use of dual IPv4/IPv6 sockets; if address is an IPv6 address, it will only accept IPv6 connections. You must configure IPv4 listening separately.

Parameters:

this

a Server

address

the address of the interface to listen on

options

listening options for this server

Returns:

true on success, false if address could not be bound or any other error occurred (in which case error will be set).




2022 vala-language.org