mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 21:27:35 +03:00
simplify the packetHandlerManager interface
This commit is contained in:
parent
9cbbdaa7b3
commit
36c77a56c9
2 changed files with 9 additions and 13 deletions
14
server.go
14
server.go
|
@ -35,14 +35,10 @@ type unknownPacketHandler interface {
|
|||
type packetHandlerManager interface {
|
||||
io.Closer
|
||||
Add(protocol.ConnectionID, packetHandler)
|
||||
Retire(protocol.ConnectionID)
|
||||
Remove(protocol.ConnectionID)
|
||||
ReplaceWithClosed(protocol.ConnectionID, packetHandler)
|
||||
AddResetToken([16]byte, packetHandler)
|
||||
RemoveResetToken([16]byte)
|
||||
GetStatelessResetToken(protocol.ConnectionID) [16]byte
|
||||
SetServer(unknownPacketHandler)
|
||||
CloseServer()
|
||||
sessionRunner
|
||||
}
|
||||
|
||||
type quicSession interface {
|
||||
|
@ -57,14 +53,6 @@ type quicSession interface {
|
|||
closeRemote(error)
|
||||
}
|
||||
|
||||
type sessionRunner interface {
|
||||
Retire(protocol.ConnectionID)
|
||||
Remove(protocol.ConnectionID)
|
||||
ReplaceWithClosed(protocol.ConnectionID, packetHandler)
|
||||
AddResetToken([16]byte, packetHandler)
|
||||
RemoveResetToken([16]byte)
|
||||
}
|
||||
|
||||
// A Listener of QUIC
|
||||
type baseServer struct {
|
||||
mutex sync.Mutex
|
||||
|
|
|
@ -72,6 +72,14 @@ func (p *receivedPacket) Clone() *receivedPacket {
|
|||
}
|
||||
}
|
||||
|
||||
type sessionRunner interface {
|
||||
Retire(protocol.ConnectionID)
|
||||
Remove(protocol.ConnectionID)
|
||||
ReplaceWithClosed(protocol.ConnectionID, packetHandler)
|
||||
AddResetToken([16]byte, packetHandler)
|
||||
RemoveResetToken([16]byte)
|
||||
}
|
||||
|
||||
type handshakeRunner struct {
|
||||
onReceivedParams func([]byte)
|
||||
onError func(error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue