Server.listenLocal

This attempts to set up @server to listen for connections on "localhost" (that is, <literal>127.0.0.1</literal> and/or <literal>::1</literal>, depending on whether @options includes %SOUP_SERVER_LISTEN_IPV4_ONLY, %SOUP_SERVER_LISTEN_IPV6_ONLY, or neither). If @port is specified, @server will listen on that port. If it is 0, @server will find an unused port to listen on. (In that case, you can use soup_server_get_uris() to find out what port it ended up choosing.)

See soup_server_listen() for more details.

class Server
bool
listenLocal

Parameters

port uint

the port to listen on, or 0

options SoupServerListenOptions

listening options for this server

Return Value

Type: bool

%TRUE on success, %FALSE if @port could not be bound or any other error occurred (in which case @error will be set).

Throws

GException on failure.

Meta

Since

2.48