예제 #1
0
 /// <summary>
 /// 通过TCP发送数据
 /// </summary>
 /// <param name="data"></param>
 public bool SendTcp(byte[] data)
 {
     if (IsValid && data != null)
     {
         if (config.UseSSL && (config.SSLMode == 0 || config.SSLMode == 1))
         {
             return(tcpClient.Send(SessionId, ssl.AESEncrypt(data)));
         }
         else
         {
             return(tcpClient.Send(SessionId, data));
         }
     }
     else
     {
         return(false);
     }
 }
예제 #2
0
 /// <summary>
 /// 发送数据 TCP
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public bool SendTcp(byte[] data)
 {
     if (IsAlive && isValid && data != null)
     {
         if (hyperSocketRef.TryGetTarget(out var hyperSocket) && hyperSocket.config.UseSSL && (hyperSocket.config.SSLMode == 0 || hyperSocket.config.SSLMode == 1))
         {
             return(tcpConn.Send(SessionId, ssl.AESEncrypt(data)));
         }
         else
         {
             return(tcpConn.Send(SessionId, data));
         }
     }