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 }; } } }