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