code: func (ep *endpoint) Shutdown(flags tcpip.ShutdownFlags) *tcpip.Error {
  	ep.mu.Lock()
  	defer ep.mu.Unlock()
  
  	if !ep.connected {
  		return tcpip.ErrNotConnected
  	}
  
  	ep.shutdownFlags |= flags
  
  	if flags&tcpip.ShutdownRead != 0 {
  		ep.rcvMu.Lock()
  		wasClosed := ep.rcvClosed
  		ep.rcvClosed = true
  		ep.rcvMu.Unlock()
  
  		if !wasClosed {
  			ep.waiterQueue.Notify(waiter.EventIn)
  		}
  	}
  
  	return nil
  }
docs: // Shutdown implements tcpip.Endpoint.Shutdown.