Source file src/syscall/net_js.go

     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.
     4  
     5  //go:build js && wasm
     6  
     7  package syscall
     8  
     9  func Socket(proto, sotype, unused int) (fd int, err error) {
    10  	return 0, ENOSYS
    11  }
    12  
    13  func Bind(fd int, sa Sockaddr) error {
    14  	return ENOSYS
    15  }
    16  
    17  func StopIO(fd int) error {
    18  	return ENOSYS
    19  }
    20  
    21  func Listen(fd int, backlog int) error {
    22  	return ENOSYS
    23  }
    24  
    25  func Accept(fd int) (newfd int, sa Sockaddr, err error) {
    26  	return 0, nil, ENOSYS
    27  }
    28  
    29  func Connect(fd int, sa Sockaddr) error {
    30  	return ENOSYS
    31  }
    32  
    33  func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
    34  	return 0, nil, ENOSYS
    35  }
    36  
    37  func Sendto(fd int, p []byte, flags int, to Sockaddr) error {
    38  	return ENOSYS
    39  }
    40  
    41  func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn, recvflags int, from Sockaddr, err error) {
    42  	return 0, 0, 0, nil, ENOSYS
    43  }
    44  
    45  func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
    46  	return 0, ENOSYS
    47  }
    48  
    49  func GetsockoptInt(fd, level, opt int) (value int, err error) {
    50  	return 0, ENOSYS
    51  }
    52  
    53  func SetsockoptInt(fd, level, opt int, value int) error {
    54  	return nil
    55  }
    56  
    57  func SetReadDeadline(fd int, t int64) error {
    58  	return ENOSYS
    59  }
    60  
    61  func SetWriteDeadline(fd int, t int64) error {
    62  	return ENOSYS
    63  }
    64  
    65  func Shutdown(fd int, how int) error {
    66  	return ENOSYS
    67  }
    68  
    69  func SetNonblock(fd int, nonblocking bool) error {
    70  	return nil
    71  }
    72  

View as plain text