コード例 #1
0
 private void Send()
 {
     if (Sending == false)
     {
         if (msg.Count() > 0)
         {
             Sending = true;
             Msg m = msg.Dequeue();
             if (m != null)
             {
                 byte[] buf = m.Serialize_Msg();
                 if (socket.CheckConnect())
                 {
                     socket.SendAsync(buf, (ok) =>
                     {
                         if (ok)
                         {
                             Sending = false;
                         }
                     });
                 }
                 else
                 {
                     msg.Enqueue(m);
                 }
             }
         }
     }
 }//end send