public bool Send(byte[] bytes, int len)
 {
     if (!Connected || currentSocket == null)
     {
         return(false);
     }
     bytes = LengthEncoding.LengthEncode(bytes);
     currentSocket.Send(bytes);
     return(true);
 }
Esempio n. 2
0
 public bool Send(byte[] bytes, int len)
 {
     if (ConnentSocket != null)
     {
         bytes = LengthEncoding.LengthEncode(bytes);
         writeBuffer.Enqueue(bytes);
         if (!isWriting)
         {
             isWriting = true;
             SendDataHandle();
         }
     }
     else
     {
         closeAction(this, "socket 不存在");
         return(false);
     }
     return(true);
 }