code: func (s *Stream) sendFlags() uint16 {
  	s.stateLock.Lock()
  	defer s.stateLock.Unlock()
  	var flags uint16
  	switch s.state {
  	case streamInit:
  		flags |= flagSYN
  		s.state = streamSYNSent
  	case streamSYNReceived:
  		flags |= flagACK
  		s.state = streamEstablished
  	}
  	return flags
  }
docs: // sendFlags determines any flags that are appropriate
  // based on the current stream state