func newEventDatagramOpen(max uint64) Event {
	return Event{
		Type: EventDatagramOpen,
		Data: max,
	}
}
newEventDatagramOpen creates an event when peer accepts DATAGRAM.
package transport
import "fmt"
const (
	EventConnOpen   = "conn_open"    
	EventConnClosed = "conn_closed"  
	EventStreamOpen      = "stream_open"       
	EventStreamReadable  = "stream_readable"   
	EventStreamWritable  = "stream_writable"   
	EventStreamCreatable = "stream_creatable"  
	EventStreamComplete  = "stream_complete"   
	EventStreamClosed    = "stream_closed"     
	EventDatagramOpen     = "datagram_open"      
	EventDatagramWritable = "datagram_writable"  
	EventDatagramReadable = "datagram_readable"  
)
type Event struct {
	Type string  
	Data uint64  
}
func (s Event) String() string {
	return fmt.Sprintf("%s:%d", s.Type, s.Data)
}
func newEventConnectionOpen() Event {
	return Event{
		Type: EventConnOpen,
	}
}
func newEventConnectionClosed() Event {
	return Event{
		Type: EventConnClosed,
	}
}
func newEventStreamOpen(id uint64) Event {
	return Event{
		Type: EventStreamOpen,
		Data: id,
	}
}
func newEventStreamReadable(id uint64) Event {
	return Event{
		Type: EventStreamReadable,
		Data: id,
	}
}
func newEventStreamWritable(id uint64) Event {
	return Event{
		Type: EventStreamWritable,
		Data: id,
	}
}
func newEventStreamCreatable(bidi bool, uni bool) Event {
	var directional uint64
	if bidi && uni {
		directional = 3
	} else if uni {
		directional = 2
	} else if bidi {
		directional = 1
	}
	return Event{
		Type: EventStreamCreatable,
		Data: directional,
	}
}
func newEventStreamComplete(id uint64) Event {
	return Event{
		Type: EventStreamComplete,
		Data: id,
	}
}
func newEventStreamClosed(id uint64) Event {
	return Event{
		Type: EventStreamClosed,
		Data: id,
	}
}