mirror of
https://github.com/soypat/lneto.git
synced 2026-08-21 15:09:05 +00:00
refactor max tcp port config values to uint16 to better represent their valid space
This commit is contained in:
+3
-2
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user