Source file src/net/fd_wasip1.go

     1  // Copyright 2023 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 wasip1
     6  
     7  package net
     8  
     9  import (
    10  	"syscall"
    11  )
    12  
    13  func (fd *netFD) closeRead() error {
    14  	if fd.fakeNetFD != nil {
    15  		return fd.fakeNetFD.closeRead()
    16  	}
    17  	return fd.shutdown(syscall.SHUT_RD)
    18  }
    19  
    20  func (fd *netFD) closeWrite() error {
    21  	if fd.fakeNetFD != nil {
    22  		return fd.fakeNetFD.closeWrite()
    23  	}
    24  	return fd.shutdown(syscall.SHUT_WR)
    25  }
    26  

View as plain text