Пример #1
0
 void IConnection.Send(Frame frame)
 {
     try
     {
         if (connected)
         {
             byte[] b = draft.CreateServerFrameBytes(frame);
             if (b != null)
             {
                 socketStream.BeginWrite(b, 0, b.Length, null, null);
             }
         }
     }
     catch (Exception ex)
     {
         ((ILogger)server).error("Writing to client failed. Removing the client from list. Error message: " + ex.Message);
         ((IConnection)this).Close();
     }
 }