MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / eventcb

Method eventcb

src/torcontrol.cpp:179–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void TorControlConnection::eventcb(struct bufferevent *bev, short what, void *ctx)
180{
181 TorControlConnection *self = static_cast<TorControlConnection*>(ctx);
182 if (what & BEV_EVENT_CONNECTED) {
183 LogPrint(BCLog::TOR, "tor: Successfully connected!\n");
184 self->connected(*self);
185 } else if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) {
186 if (what & BEV_EVENT_ERROR) {
187 LogPrint(BCLog::TOR, "tor: Error connecting to Tor control socket\n");
188 } else {
189 LogPrint(BCLog::TOR, "tor: End of stream\n");
190 }
191 self->Disconnect();
192 self->disconnected(*self);
193 }
194}
195
196bool TorControlConnection::Connect(const std::string &target, const ConnectionCB& _connected, const ConnectionCB& _disconnected)
197{

Callers

nothing calls this directly

Calls 1

DisconnectMethod · 0.95

Tested by

no test coverage detected