refactor max tcp port config values to uint16 to better represent their valid space

This commit is contained in:
Patricio Whittingslow
2026-04-09 20:13:45 -03:00
parent 548d96da95
commit 568ef2854f
12 changed files with 129 additions and 124 deletions
+3 -2
View File
@@ -32,7 +32,8 @@ func _() {
}
type TCPPoolConfig struct {
PoolSize int
// PoolSize determines the maximum number of active incoming TCP connections to the pool.
PoolSize uint16
QueueSize int
TxBufSize int
RxBufSize int
@@ -58,7 +59,7 @@ func NewTCPPool(cfg TCPPoolConfig) (*TCPPool, error) {
if cfg.EstablishedTimeout <= 0 || cfg.ClosingTimeout <= 0 {
return nil, lneto.ErrInvalidConfig
}
n := cfg.PoolSize
n := int(cfg.PoolSize)
pool := &TCPPool{
acquiredAt: make([]int64, n),
closingAt: make([]int64, n),