Exemplo n.º 1
0
 /// <summary>发送消息(部分客户端) deviceIdList:客户端列表</summary>
 public void SendMsgAll(SocketMsg msg)
 {
     byte[] bytes = SocketTools.PackageNetMsg(msg);
     foreach (SessionTcp session in clientKeyValuePairs.Keys)
     {
         session.SendMsg(bytes);
     }
 }
Exemplo n.º 2
0
 /// <summary>发送消息(部分客户端) deviceIdList:客户端列表</summary>
 public void SendMsgAll(SocketMsg msg, List <string> deviceIdList)
 {
     byte[] bytes = SocketTools.PackageNetMsg(msg);
     foreach (SessionTcp session in clientKeyValuePairs.Keys)
     {
         if (deviceIdList.Contains(clientKeyValuePairs[session]))
         {
             session.SendMsg(bytes);
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>发送消息</summary>
 public void SendMsg(SocketMsg msg)
 {
     if (client != null && client.session != null)
     {
         try
         {
             client.session.SendMsg(SocketTools.PackageNetMsg(msg));
         }
         catch (Exception e)
         {
             Debug.LogError(e);
         }
     }
 }
Exemplo n.º 4
0
 /// <summary>发送消息</summary>
 public void SendMsg(SessionTcp session, SocketMsg msg)
 {
     if (session != null)
     {
         try
         {
             byte[] bytes = SocketTools.PackageNetMsg(msg);
             session.SendMsg(bytes);
         }
         catch (Exception e)
         {
             Debug.LogError(e);
         }
     }
 }