From 1698d2e04c24512864c25cded6cc995c1cf9031c Mon Sep 17 00:00:00 2001 From: Angelia Date: Sat, 6 May 2023 21:50:24 +0800 Subject: [PATCH] route delete bind (#100) Co-authored-by: van --- session/router.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/session/router.go b/session/router.go index bd6ce9d8..324b565c 100644 --- a/session/router.go +++ b/session/router.go @@ -36,6 +36,13 @@ func (r *Router) Bind(service, address string) { r.routes.Store(service, address) } +// Delete route delete bind for +// 1. some son-service restart, sadly it's not auto bind new son-service +// 2. some game have match to some service, delete bind and match customer service +func (r *Router) Delete(service string) { + r.routes.Delete(service) +} + // Find finds the address corresponding a remote service func (r *Router) Find(service string) (string, bool) { v, found := r.routes.Load(service)