)
The address
can either be a String or an
InternetAddress. If address
is a String, bind will
perform a InternetAddress.lookup and use the first value in the
list. To listen on the loopback adapter, which will allow only
incoming connections from the local host, use the value
InternetAddress.LOOPBACK_IP_V4 or
InternetAddress.LOOPBACK_IP_V6. To allow for incoming
connection from the network use either one of the values
InternetAddress.ANY_IP_V4 or InternetAddress.ANY_IP_V6 to
bind to all interfaces or the IP address of a specific interface.
If an IP version 6 (IPv6) address is used, both IP version 6
(IPv6) and version 4 (IPv4) connections will be accepted. To
restrict this to version 6 (IPv6) only, use v6Only
to set
version 6 only.
If port
has the value 0
an ephemeral port will be chosen by
the system. The actual port used can be retrieved using the
port
getter.
The optional argument backlog
can be used to specify the listen
backlog for the underlying OS listen setup. If backlog
has the
value of 0
(the default) a reasonable value will be chosen by
the system.
The certificate with nickname or distinguished name (DN) certificateName
is looked up in the certificate database, and is used as the server
certificate. If requestClientCertificate
is true, the server will
request clients to authenticate with a client certificate.
The optional argument shared
specify whether additional binds
to the same address
, port
and v6Only
combination is
possible from the same Dart process. If shared
is true
and
additional binds are performed, then the incoming connections
will be distributed between that set of HttpServer
s. One way of
using this is to have number of isolates between which incoming
connections are distributed.
Source
/**
* The [address] can either be a [String] or an
* [InternetAddress]. If [address] is a [String], [bind] will
* perform a [InternetAddress.lookup] and use the first value in the
* list. To listen on the loopback adapter, which will allow only
* incoming connections from the local host, use the value
* [InternetAddress.LOOPBACK_IP_V4] or
* [InternetAddress.LOOPBACK_IP_V6]. To allow for incoming
* connection from the network use either one of the values
* [InternetAddress.ANY_IP_V4] or [InternetAddress.ANY_IP_V6] to
* bind to all interfaces or the IP address of a specific interface.
*
* If an IP version 6 (IPv6) address is used, both IP version 6
* (IPv6) and version 4 (IPv4) connections will be accepted. To
* restrict this to version 6 (IPv6) only, use [v6Only] to set
* version 6 only.
*
* If [port] has the value [:0:] an ephemeral port will be chosen by
* the system. The actual port used can be retrieved using the
* [port] getter.
*
* The optional argument [backlog] can be used to specify the listen
* backlog for the underlying OS listen setup. If [backlog] has the
* value of [:0:] (the default) a reasonable value will be chosen by
* the system.
*
* The certificate with nickname or distinguished name (DN) [certificateName]
* is looked up in the certificate database, and is used as the server
* certificate. If [requestClientCertificate] is true, the server will
* request clients to authenticate with a client certificate.
*
* The optional argument [shared] specify whether additional binds
* to the same `address`, `port` and `v6Only` combination is
* possible from the same Dart process. If `shared` is `true` and
* additional binds are performed, then the incoming connections
* will be distributed between that set of `HttpServer`s. One way of
* using this is to have number of isolates between which incoming
* connections are distributed.
*/
static Future<HttpServer> bindSecure(address,
int port,
{int backlog: 0,
bool v6Only: false,
String certificateName,
bool requestClientCertificate: false,
bool shared: false})
=> _HttpServer.bindSecure(address,
port,
backlog,
v6Only,
certificateName,
requestClientCertificate,
shared);