diff --git a/gate/kcp/session.go b/gate/kcp/session.go index 9b96213f..3c56cf17 100644 --- a/gate/kcp/session.go +++ b/gate/kcp/session.go @@ -56,6 +56,15 @@ func init() { } } +const ( + batchSize = 16 +) + +type batchConn interface { + WriteBatch(ms []ipv4.Message, flags int) (int, error) + ReadBatch(ms []ipv4.Message, flags int) (int, error) +} + type ( // UDPSession defines a KCP session implemented by UDP UDPSession struct { diff --git a/gate/kcp/udp_socket_linux.go b/gate/kcp/udp_socket_linux.go index b1551d2e..856cc6eb 100644 --- a/gate/kcp/udp_socket_linux.go +++ b/gate/kcp/udp_socket_linux.go @@ -13,15 +13,6 @@ import ( "golang.org/x/net/ipv6" ) -const ( - batchSize = 16 -) - -type batchConn interface { - WriteBatch(ms []ipv4.Message, flags int) (int, error) - ReadBatch(ms []ipv4.Message, flags int) (int, error) -} - // the read loop for a client session func (s *UDPSession) readLoop() { // default version