code: func (e *endpoint) GetSockOpt(opt interface{}) *tcpip.Error {
  	switch o := opt.(type) {
  	case tcpip.ErrorOption:
  		return nil
  
  	case *tcpip.SendBufferSizeOption:
  		e.mu.Lock()
  		*o = tcpip.SendBufferSizeOption(e.sndBufSize)
  		e.mu.Unlock()
  		return nil
  
  	case *tcpip.ReceiveBufferSizeOption:
  		e.rcvMu.Lock()
  		*o = tcpip.ReceiveBufferSizeOption(e.rcvBufSizeMax)
  		e.rcvMu.Unlock()
  		return nil
  
  	case *tcpip.ReceiveQueueSizeOption:
  		e.rcvMu.Lock()
  		if e.rcvList.Empty() {
  			*o = 0
  		} else {
  			p := e.rcvList.Front()
  			*o = tcpip.ReceiveQueueSizeOption(p.data.Size())
  		}
  		e.rcvMu.Unlock()
  		return nil
  
  	case *tcpip.KeepaliveEnabledOption:
  		*o = 0
  		return nil
  
  	default:
  		return tcpip.ErrUnknownProtocolOption
  	}
  }
docs: // GetSockOpt implements tcpip.Endpoint.GetSockOpt.