private void SendBytes(byte[] bytes, Fleck2Extensions.Action callback = null)
 {
     Socket.Send(bytes, () =>
     {
         FleckLog.Debug("Sent " + bytes.Length + " bytes");
         if (callback != null)
         {
             callback();
         }
     },
                 e =>
     {
         if (e is IOException)
         {
             FleckLog.Debug("Failed to send. Disconnecting.", e);
         }
         else
         {
             FleckLog.Info("Failed to send. Disconnecting.", e);
         }
         CloseSocket();
     });
 }
Exemple #2
0
 private void ListenForClients()
 {
     ListenerSocket.Accept(OnClientConnect, e => FleckLog.Error("Listener socket is closed", e));
 }