MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / Bind

Method Bind

internal/nodes/client_conn_base.go:44–55  ·  view source on GitHub ↗

Bind 绑定服务

(serverId int64, remoteAddr string, maxConnsPerServer int, maxConnsPerIP int)

Source from the content-addressed store, hash-verified

42
43// Bind 绑定服务
44func (this *BaseClientConn) Bind(serverId int64, remoteAddr string, maxConnsPerServer int, maxConnsPerIP int) bool {
45 if this.isBound {
46 return true
47 }
48 this.isBound = true
49 this.serverId = serverId
50 this.remoteAddr = remoteAddr
51 this.hasLimit = true
52
53 // 检查是否可以连接
54 return sharedClientConnLimiter.Add(this.rawConn.RemoteAddr().String(), serverId, remoteAddr, maxConnsPerServer, maxConnsPerIP)
55}
56
57// SetServerId 设置服务ID
58func (this *BaseClientConn) SetServerId(serverId int64) (goNext bool) {

Callers

nothing calls this directly

Calls 3

AddMethod · 0.65
StringMethod · 0.45
RemoteAddrMethod · 0.45

Tested by

no test coverage detected