コード例 #1
0
        public virtual void broadcast_rpc_Handle(ConnectorBroadcastNotify notify)
        {
            var sockets = sessionMap.GetNotifySockets(notify.serverGroups, notify.sessions);
            var binary  = ClientCodec.ToBinary(notify.notify);

            foreach (var socket in sockets)
            {
                socket.Send(binary);
            }
        }
コード例 #2
0
 public override void OnWormholeTransported(RemoteAddress from, object message)
 {
     if (message is ConnectorBroadcastNotify notify)
     {
         var sockets = sessionMap.GetNotifySockets(notify.serverGroups, notify.sessions);
         var binary  = ClientCodec.ToBinary(notify.notify);
         foreach (var socket in sockets)
         {
             socket.Send(binary);
         }
     }
     else if (message is ISerializable toall)
     {
         acceptor.Broadcast(toall);
     }
 }