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
50 type SockaddrInet4 struct {
55 type SockaddrInet6 struct {
61 type SockaddrUnix struct {
65 func Socket(proto, sotype, unused int) (fd int, err error) {
69 func Bind(fd int, sa Sockaddr) error {
73 func StopIO(fd int) error {
77 func Listen(fd int, backlog int) error {
81 func Accept(fd int) (newfd int, sa Sockaddr, err error) {
85 func Connect(fd int, sa Sockaddr) error {
89 func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
93 func Sendto(fd int, p []byte, flags int, to Sockaddr) error {
97 func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn, recvflags int, from Sockaddr, err error) {
98 return 0, 0, 0, nil, ENOSYS
101 func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
105 func GetsockoptInt(fd, level, opt int) (value int, err error) {
109 func SetsockoptInt(fd, level, opt int, value int) error {
113 func SetReadDeadline(fd int, t int64) error {
117 func SetWriteDeadline(fd int, t int64) error {
121 func Shutdown(fd int, how int) error {
125 func SetNonblock(fd int, nonblocking bool) error {