Add brutal infra

This commit is contained in:
Fangliding
2025-12-11 12:13:14 +08:00
parent 6a909b2507
commit 65da3d9c9d
5 changed files with 72 additions and 6 deletions
+2 -2
View File
@@ -170,7 +170,7 @@ func (f *DialingWorkerFactory) Create() (*ClientWorker, error) {
type ClientStrategy struct {
MaxConcurrency uint32
MaxConnection uint32
MaxReuseTimes uint32
}
type ClientWorker struct {
@@ -288,7 +288,7 @@ func fetchInput(ctx context.Context, s *Session, output buf.Writer) {
func (m *ClientWorker) IsClosing() bool {
sm := m.sessionManager
if m.strategy.MaxConnection > 0 && sm.Count() >= int(m.strategy.MaxConnection) {
if m.strategy.MaxReuseTimes > 0 && sm.Count() >= int(m.strategy.MaxReuseTimes) {
return true
}
return false