added code dealing with server-side peers

This commit is contained in:
2025-02-15 19:44:48 +09:00
parent cb18a44cfa
commit f2536a0acc
3 changed files with 186 additions and 14 deletions

View File

@ -278,14 +278,14 @@ func (r *ClientRoute) ReqStopAllClientPeerConns() {
r.ptc_mtx.Unlock()
}
func (r *ClientRoute) FindClientPeerConnById(conn_id PeerId) *ClientPeerConn {
func (r *ClientRoute) FindClientPeerConnById(peer_id PeerId) *ClientPeerConn {
var c *ClientPeerConn
var ok bool
r.ptc_mtx.Lock()
defer r.ptc_mtx.Unlock()
c, ok = r.ptc_map[conn_id]
c, ok = r.ptc_map[peer_id]
if !ok { return nil }
return c