tractor.dev/toolkit-go@v0.0.0-20241010005851-214d91207d07/duplex/mux/listen.go (about) 1 package mux 2 3 import "net" 4 5 // A Listener is similar to a net.Listener but returns connections wrapped as mux sessions. 6 type Listener interface { 7 // Close closes the listener. 8 // Any blocked Accept operations will be unblocked and return errors. 9 Close() error 10 11 // Accept waits for and returns the next incoming session. 12 Accept() (Session, error) 13 14 // Addr returns the listener's network address if available. 15 Addr() net.Addr 16 }