created event firing functions under server and client to replace directy bulleting enqueing

This commit is contained in:
2025-03-28 17:03:17 +09:00
parent fd28add458
commit 76cba687ed
6 changed files with 270 additions and 175 deletions

View File

@ -26,6 +26,7 @@ func (cpc *ClientPeerConn) RunTask(wg *sync.WaitGroup) error {
var n int
defer wg.Done()
cpc.route.cts.C.FirePeerEvent(CLIENT_EVENT_PEER_STARTED, cpc)
for {
n, err = cpc.conn.Read(buf[:])
@ -65,6 +66,7 @@ func (cpc *ClientPeerConn) RunTask(wg *sync.WaitGroup) error {
cpc.node_in_conn = nil
cpc.route.cts.ptc_mtx.Unlock()
cpc.route.cts.C.FirePeerEvent(CLIENT_EVENT_PEER_STOPPED, cpc)
return nil
}