1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // js/wasm uses fake networking directly implemented in the net package.
6 // This file only exists to make the compiler happy.
20 SOCK_STREAM
= 1 + iota
41 // Misc constants expected by package net but not supported.
45 SYS_FCNTL
= 500 // unsupported; same value as net_nacl.go
48 type Sockaddr
interface {
51 type SockaddrInet4
struct {
56 type SockaddrInet6
struct {
62 type SockaddrUnix
struct {
66 func Socket(proto
, sotype
, unused
int) (fd
int, err error
) {
70 func Bind(fd
int, sa Sockaddr
) error
{
74 func StopIO(fd
int) error
{
78 func Listen(fd
int, backlog
int) error
{
82 func Accept(fd
int) (newfd
int, sa Sockaddr
, err error
) {
86 func Connect(fd
int, sa Sockaddr
) error
{
90 func Recvfrom(fd
int, p
[]byte, flags
int) (n
int, from Sockaddr
, err error
) {
94 func Sendto(fd
int, p
[]byte, flags
int, to Sockaddr
) error
{
98 func Recvmsg(fd
int, p
, oob
[]byte, flags
int) (n
, oobn
, recvflags
int, from Sockaddr
, err error
) {
99 return 0, 0, 0, nil, ENOSYS
102 func SendmsgN(fd
int, p
, oob
[]byte, to Sockaddr
, flags
int) (n
int, err error
) {
106 func GetsockoptInt(fd
, level
, opt
int) (value
int, err error
) {
110 func SetsockoptInt(fd
, level
, opt
int, value
int) error
{
114 func SetReadDeadline(fd
int, t
int64) error
{
118 func SetWriteDeadline(fd
int, t
int64) error
{
122 func Shutdown(fd
int, how
int) error
{
126 func SetNonblock(fd
int, nonblocking
bool) error
{