Skip to content

Commit

Permalink
Shadowsocks2022 Client Implementation Improvements (again)
Browse files Browse the repository at this point in the history
1. Adjust server session track time
2. Increase per session buffer to 128
  • Loading branch information
xiaokangwang committed Nov 22, 2023
1 parent 0a5e223 commit 668581d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions proxy/shadowsocks2022/client_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (c *ClientUDPSession) NewSessionConn() (internet.AbstractPacketConn, error)

sessionConn := &ClientUDPSessionConn{
sessionID: string(sessionID),
readChan: make(chan *UDPResponse, 16),
readChan: make(chan *UDPResponse, 128),
parent: c,
ctx: connctx,
finish: connfinish,
Expand Down Expand Up @@ -261,7 +261,7 @@ func (c *ClientUDPSessionConn) ReadFrom(p []byte) (n int, addr net.Addr, err err
if trackedStateReceived, ok := c.trackedServerSessionID[string(resp.SessionID[:])]; !ok {
expiredServerSessionID := make([]string, 0)
for key, value := range c.trackedServerSessionID {
if time.Since(value.lastSeen) > 125*time.Second {
if time.Since(value.lastSeen) > 65*time.Second {
expiredServerSessionID = append(expiredServerSessionID, key)
}
}
Expand Down

0 comments on commit 668581d

Please sign in to comment.