mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
smux: return os.ErrDeadlineExceeded when timeout
This commit is contained in:
1 parent
e9e4515e67
commit
70cf30b5e6
4 files changed
+16
-8
No files matched your search
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"net"
|
||||
"net/url"
|
||||
"sync"
|
||||
|
||||
"github.com/nadoo/glider/log"
|
||||
"github.com/nadoo/glider/proxy"
|
||||
@@ -15,6 +16,7 @@ import (
|
||||
type SmuxClient struct {
|
||||
dialer proxy.Dialer
|
||||
addr string
|
||||
mu sync.Mutex
|
||||
session *smux.Session
|
||||
}
|
||||
|
||||
@@ -66,6 +68,9 @@ func (s *SmuxClient) DialUDP(network, addr string) (net.PacketConn, net.Addr, er
|
||||
}
|
||||
|
||||
func (s *SmuxClient) initConn() error {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
conn, err := s.dialer.Dial("tcp", s.addr)
|
||||
if err != nil {
|
||||
log.F("[smux] dial to %s error: %s", s.addr, err)
|
||||
|
||||
Reference in new issue
Block a user