mirror of https://github.com/grpc/grpc-dart.git
parent
caa1a31bb8
commit
ae17e712e4
|
|
@ -88,18 +88,24 @@ class Server {
|
|||
{dynamic address,
|
||||
int port,
|
||||
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.
|
||||
Stream<Socket> server;
|
||||
if (security != null) {
|
||||
_secureServer = await SecureServerSocket.bind(
|
||||
address ?? InternetAddress.anyIPv4,
|
||||
port ?? 443,
|
||||
security.securityContext);
|
||||
security.securityContext,
|
||||
backlog: backlog,
|
||||
shared: shared,
|
||||
v6Only: v6Only);
|
||||
server = _secureServer;
|
||||
} else {
|
||||
_insecureServer = await ServerSocket.bind(
|
||||
address ?? InternetAddress.anyIPv4, port ?? 80);
|
||||
address ?? InternetAddress.anyIPv4, port ?? 80, backlog: backlog, shared: shared , v6Only: v6Only);
|
||||
server = _insecureServer;
|
||||
}
|
||||
server.listen((socket) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue