Refactor(core): with error callback

This commit is contained in:
xjasonlyu
2022-03-29 17:19:54 +08:00
parent 0a9f7f123c
commit 3999c5d66b
5 changed files with 61 additions and 19 deletions

View File

@@ -1,14 +1,8 @@
package adapter
// TransportHandler is a TCP/UDP connection handler that implements
// HandleTCPConn and HandleUDPConn methods.
// HandleTCP and HandleUDP methods.
type TransportHandler interface {
HandleTCP(TCPConn)
HandleUDP(UDPConn)
}
// TCPHandleFunc handles incoming TCP connection.
type TCPHandleFunc func(TCPConn)
// UDPHandleFunc handles incoming UDP connection.
type UDPHandleFunc func(UDPConn)