FACT++  1.0
void Connection::CloseImp ( bool  restart = true)
private

Definition at line 89 of file Connection.cc.

References Agilent::State::kDisconnected, and str.

Referenced by AsyncWait(), and PostClose().

90 {
91  if (IsConnected() && fVerbose)
92  {
93  ostringstream str;
94  str << "Connection closed to " << URL() << ".";
95  Info(str);
96  }
97 
98  // Stop any pending connection attempt
99  fConnectionTimer.cancel();
100 
101  // Close possible open connections
102  close();
103 
104  // Reset the connection status
105  fQueueSize = 0;
107 
108  // Stop deadline counters
109  fInTimeout.cancel();
110  fOutTimeout.cancel();
111 
112  if (!restart || IsConnecting())
113  return;
114 
115  // We need some timeout before reconnecting!
116  // And we have to check if we are alreayd trying to connect
117  // We shoudl wait until all operations in progress were canceled
118 
119  // Start trying to reconnect
120  fMsgConnect = "";
121  fErrConnect = "";
122  StartConnect();
123 }
boost::asio::deadline_timer fConnectionTimer
Definition: Connection.h:40
boost::asio::deadline_timer fInTimeout
Definition: Connection.h:36
char str[80]
Definition: test_client.c:7
bool IsConnected() const
Definition: Connection.h:145
bool IsConnecting() const
Definition: Connection.h:146
ConnectionStatus_t fConnectionStatus
Definition: Connection.h:44
virtual void StartConnect()
Definition: Connection.cc:352
std::string URL() const
Definition: Connection.h:151
std::string fErrConnect
Definition: Connection.h:46
std::string fMsgConnect
Definition: Connection.h:47
int Info(const std::string &str)
Definition: MessageImp.h:47
bool fVerbose
Definition: Connection.h:25
boost::asio::deadline_timer fOutTimeout
Definition: Connection.h:39
size_t fQueueSize
Definition: Connection.h:42

+ Here is the caller graph for this function: