private void AppendToLog(ActivityMessage action) { if (!IsActive || AllLoggingPaused) { return; } if (action.DeviceType == DeviceTypeEnum.Telescope && EnableTelescopeLogging || action.DeviceType == DeviceTypeEnum.Dome && EnableDomeLogging || action.DeviceType == DeviceTypeEnum.Focuser && EnableFocuserLogging) { if (action.MessageType == ActivityMessageTypes.Capabilities && EnableCapabilitiesLogging || action.MessageType == ActivityMessageTypes.Commands && EnableCommandLogging || action.MessageType == ActivityMessageTypes.Other && EnableOthersLogging || action.MessageType == ActivityMessageTypes.Parameters && EnableParametersLogging || action.MessageType == ActivityMessageTypes.Status && EnableStatusLogging) { string newText = FormatEntry(action.MessageText); // UpdateTheLog( newText ); lock ( _bufferLock ) { DataBuffer.Append(newText); } } } }
public void SendDataTo(Int32 id, Byte[] data) { try { var b = new DataBuffer(); b.WriteInt32(data.Length); b.Append(data); Clients[id].BeginSend(b.ToArray(), 0, (Int32)b.Length(), SocketFlags.None, new AsyncCallback(DataSent), Clients[id]); } catch { } }
public void SendData(Byte[] data) { var b = new DataBuffer(); b.WriteInt32(data.Length); b.Append(data); try { this.MainSocket.BeginSend(b.ToArray(), 0, (Int32)b.Length(), SocketFlags.None, new AsyncCallback(DataSent), null); } catch { } }