// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://github.com/WICG/direct-sockets/blob/main/docs/explainer.md#tcp
enum SocketDnsQueryType { "ipv4", "ipv6" };
dictionary SocketOptions {
[EnforceRange] unsigned long sendBufferSize;
[EnforceRange] unsigned long receiveBufferSize;
};
dictionary TCPSocketOptions : SocketOptions {
boolean noDelay = false;
[EnforceRange] unsigned long keepAliveDelay;
SocketDnsQueryType dnsQueryType;
};
dictionary UDPSocketOptions : SocketOptions {
DOMString remoteAddress;
[EnforceRange] unsigned short remotePort;
DOMString localAddress;
[EnforceRange] unsigned short localPort;
SocketDnsQueryType dnsQueryType;
// TODO(crbug.com/1413161): Implement ipv6Only support.
boolean ipv6Only;
};
dictionary TCPServerSocketOptions {
[EnforceRange] unsigned short localPort;
[EnforceRange] unsigned long backlog;
// TODO(crbug.com/1413161): Implement ipv6Only support.
boolean ipv6Only;
};