// Close implements tcpip.Endpoint.Close.
Close implements tcpip.Endpoint.Close.
// Close implements tcpip . Endpoint . Close .
func (e *endpoint) Close() {
	e.mu.Lock()
	defer e.mu.Unlock()
	if e.closed || !e.associated {
		return
	}
	e.stack.UnregisterRawTransportEndpoint(e.NetProto, e.TransProto, e)
	e.rcvMu.Lock()
	defer e.rcvMu.Unlock()
	e.rcvClosed = true
	e.rcvBufSize = 0
	for !e.rcvList.Empty() {
		e.rcvList.Remove(e.rcvList.Front())
	}
	e.connected = false
	if e.route != nil {
		e.route.Release()
		e.route = nil
	}
	e.closed = true
	e.waiterQueue.Notify(waiter.EventHUp | waiter.EventErr | waiter.ReadableEvents | waiter.WritableEvents)
}
func ( e * endpoint ) Close ( ) { e . mu . Lock ( ) defer e . mu . Unlock ( ) if e . closed || ! e . associated { return } e . stack . UnregisterRawTransportEndpoint ( e . NetProto , e . TransProto , e ) e . rcvMu . Lock ( ) defer e . rcvMu . Unlock ( ) e . rcvClosed = true e . rcvBufSize = 0 for ! e . rcvList . Empty ( ) { e . rcvList . Remove ( e . rcvList . Front ( ) ) } e . connected = false if e . route != nil { e . route . Release ( ) e . route = nil } e . closed = true e . waiterQueue . Notify ( waiter . EventHUp | waiter . EventErr | waiter . ReadableEvents | waiter . WritableEvents ) }
Close implements tcpip.Endpoint.Close.
Close implements tcpip . Endpoint . Close .
// Clear the receive list.