mirror of https://github.com/grpc/grpc-dart.git
parent
caa1a31bb8
commit
ae17e712e4
|
|
@ -88,18 +88,24 @@ class Server {
|
||||||
{dynamic address,
|
{dynamic address,
|
||||||
int port,
|
int port,
|
||||||
ServerTlsCredentials security,
|
ServerTlsCredentials security,
|
||||||
ServerSettings http2ServerSettings}) async {
|
ServerSettings http2ServerSettings,
|
||||||
|
int backlog: 0,
|
||||||
|
bool v6Only: false,
|
||||||
|
bool shared: false}) async {
|
||||||
// TODO(dart-lang/grpc-dart#9): Handle HTTP/1.1 upgrade to h2c, if allowed.
|
// TODO(dart-lang/grpc-dart#9): Handle HTTP/1.1 upgrade to h2c, if allowed.
|
||||||
Stream<Socket> server;
|
Stream<Socket> server;
|
||||||
if (security != null) {
|
if (security != null) {
|
||||||
_secureServer = await SecureServerSocket.bind(
|
_secureServer = await SecureServerSocket.bind(
|
||||||
address ?? InternetAddress.anyIPv4,
|
address ?? InternetAddress.anyIPv4,
|
||||||
port ?? 443,
|
port ?? 443,
|
||||||
security.securityContext);
|
security.securityContext,
|
||||||
|
backlog: backlog,
|
||||||
|
shared: shared,
|
||||||
|
v6Only: v6Only);
|
||||||
server = _secureServer;
|
server = _secureServer;
|
||||||
} else {
|
} else {
|
||||||
_insecureServer = await ServerSocket.bind(
|
_insecureServer = await ServerSocket.bind(
|
||||||
address ?? InternetAddress.anyIPv4, port ?? 80);
|
address ?? InternetAddress.anyIPv4, port ?? 80, backlog: backlog, shared: shared , v6Only: v6Only);
|
||||||
server = _insecureServer;
|
server = _insecureServer;
|
||||||
}
|
}
|
||||||
server.listen((socket) {
|
server.listen((socket) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue