From b02114f0f927df823597ce6df65dcac00597f229 Mon Sep 17 00:00:00 2001 From: Eveldee Date: Sat, 23 Mar 2019 22:41:13 +0100 Subject: [PATCH] Fix coding style in PingCommand new string[] -> new[] --- PlantBox.Broker/Program.cs | 6 ++---- PlantBox.Shared/Communication/Commands/PingCommand.cs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/PlantBox.Broker/Program.cs b/PlantBox.Broker/Program.cs index 189a1bf..988578b 100644 --- a/PlantBox.Broker/Program.cs +++ b/PlantBox.Broker/Program.cs @@ -21,13 +21,11 @@ namespace PlantBox.Broker var client = listener.AcceptTcpClient(); var stream = new CommandStream(client.GetStream()); - var command = stream.Receive(); + (var command, var ping) = stream.Receive(); Console.WriteLine(command); - - var ping = new Ping().Deserialize(command.Arguments); Console.WriteLine($"Ping: {ping.Message}"); - stream.Send(new Ping(ping.Message).ToCommandPacket(Command.Ping, command.ID)); + stream.Send(new PingCommand(ping.Message).ToCommandPacket(command.ID)); } catch (Exception) { diff --git a/PlantBox.Shared/Communication/Commands/PingCommand.cs b/PlantBox.Shared/Communication/Commands/PingCommand.cs index ac5cd9a..655c994 100644 --- a/PlantBox.Shared/Communication/Commands/PingCommand.cs +++ b/PlantBox.Shared/Communication/Commands/PingCommand.cs @@ -37,7 +37,7 @@ namespace PlantBox.Shared.Communication.Commands public override string[] Serialize() { - return new string[] { Message }; + return new[] { Message }; } } }