/// <summary> /// Send request to Sphinx server using underlying data stream and process server response. /// Connection behaviour is changed - underlying network connection will not closed until <see cref="PersistentTcpConnection.Close()"/> method is called or object is disposed. /// </summary> /// <param name="command">Command to execute</param> internal override void PerformCommand(CommandBase command) { ArgumentAssert.IsNotNull(command, "command"); if (!IsConnected) { Open(); } command.Serialize(DataStream); DataStream.Flush(); command.Deserialize(DataStream); }
/// <summary> /// Send request to Sphinx server using underlying data stream and process server response. /// </summary> /// <param name="command">Command extending <see cref="CommandBase"/> class.</param> internal override void PerformCommand(CommandBase command) { ArgumentAssert.IsNotNull(command, "command"); Open(); try { SendHandshake(); command.Serialize(DataStream); DataStream.Flush(); command.Deserialize(DataStream); } finally { Close(); } }
internal override void PerformCommand(CommandBase command) { ArgumentAssert.IsNotNull(command, "command"); Open(); try { if (!SkipHandshake) { base.SendHandshake(); } if (!SkipSerializeCommand) { command.Serialize(DataStream); } DataStream.Flush(); if (!SkipDeserializeCommand) { command.Deserialize(DataStream); } } finally { Close(); } }