public void GetTextSize() { SendPacket(new NormalPacket(OptionCommandToken.CreateGet(OptionCommandToken.OptionType.TDS_OPT_TEXTSIZE))); var doneHandler = new DoneTokenHandler(); var messageHandler = new MessageTokenHandler(); var dataReaderHandler = new DataReaderTokenHandler(); ReceiveTokens( new EnvChangeTokenHandler(_environment), messageHandler, dataReaderHandler, doneHandler); messageHandler.AssertNoErrors(); }
public bool Ping() { try { AssertExecutionStart(); SendPacket(new NormalPacket(OptionCommandToken.CreateGet(OptionCommandToken.OptionType.TDS_OPT_STAT_TIME))); var messageHandler = new MessageTokenHandler(); ReceiveTokens(messageHandler); AssertExecutionCompletion(); messageHandler.AssertNoErrors(); return(true); } catch (Exception ex) { Logger.Instance?.WriteLine($"Internal ping resulted in exception: {ex}"); IsDoomed = true; return(false); } }