func (buffer *Buffer) Add(packet Packet) {
	buffer.Lock()
	defer buffer.Unlock()

	if buffer.closed {
		return
	}

	buffer.payload = append(buffer.payload, packet)

	buffer.flushCondition.Broadcast()
}
// Add adds new packet to the payload buffer
Add adds new packet to the payload buffer
// Add adds new packet to the payload buffer
func (buffer *Buffer) Add(packet Packet) {
	buffer.Lock()
	defer buffer.Unlock()
	if buffer.closed {
		return
	}
	buffer.payload = append(buffer.payload, packet)
	buffer.flushCondition.Broadcast()
}
func ( buffer * Buffer ) Add ( packet Packet ) { buffer . Lock ( ) defer buffer . Unlock ( ) if buffer . closed { return } buffer . payload = append ( buffer . payload , packet ) buffer . flushCondition . Broadcast ( ) }
Add adds new packet to the payload buffer
Add adds new packet to the payload buffer