mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 16:14:02 +03:00
Make connection multiplexing configurable
This commit is contained in:
@@ -3,9 +3,9 @@ package hub
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
)
|
||||
|
||||
const connectionListMaxClientsPerConnection = 2
|
||||
"github.com/9seconds/mtg/config"
|
||||
)
|
||||
|
||||
type connectionList struct {
|
||||
connections []*connection
|
||||
@@ -16,7 +16,7 @@ func (c *connectionList) Get(conn *ProxyConn) (*connection, error) {
|
||||
c.gc()
|
||||
}
|
||||
|
||||
if len(c.connections) > 0 && c.connections[0].Len() < connectionListMaxClientsPerConnection {
|
||||
if len(c.connections) > 0 && c.connections[0].Len() < config.C.MultiplexPerConnection {
|
||||
if err := c.connections[0].Attach(conn); err == nil {
|
||||
return c.connections[0], nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user