Exposing Restart #72
|
@ -28,6 +28,9 @@ type ACN interface {
|
||||||
// Sets the calback function to be called when ACN status changes
|
// Sets the calback function to be called when ACN status changes
|
||||||
SetStatusCallback(callback func(int, string))
|
SetStatusCallback(callback func(int, string))
|
||||||
|
|
||||||
|
// Restart the underlying connection
|
||||||
|
Restart()
|
||||||
|
|
||||||
// Open takes a hostname and returns a net.conn to the derived endpoint
|
// Open takes a hostname and returns a net.conn to the derived endpoint
|
||||||
// Open allows a client to resolve various hostnames to connections
|
// Open allows a client to resolve various hostnames to connections
|
||||||
// The supported types are onions address are:
|
// The supported types are onions address are:
|
||||||
|
|
|
@ -38,6 +38,10 @@ func (lp *localProvider) SetStatusCallback(callback func(int, string)) {
|
||||||
// nop
|
// nop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (lp *localProvider) Restart() {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
|
|
||||||
// WaitTillBootstrapped Blocks until underlying network is bootstrapped
|
// WaitTillBootstrapped Blocks until underlying network is bootstrapped
|
||||||
func (lp *localProvider) WaitTillBootstrapped() {
|
func (lp *localProvider) WaitTillBootstrapped() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,6 +174,13 @@ func (tp *torProvider) Open(hostname string) (net.Conn, string, error) {
|
||||||
return conn, resolvedHostname, err
|
return conn, resolvedHostname, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (tp *torProvider) Restart() {
|
||||||
|
if tp.statusCallback != nil {
|
||||||
|
tp.statusCallback(0, "rebooting")
|
||||||
|
}
|
||||||
|
tp.restart()
|
||||||
|
}
|
||||||
|
|
||||||
func (tp *torProvider) Close() {
|
func (tp *torProvider) Close() {
|
||||||
for _, child := range tp.childListeners {
|
for _, child := range tp.childListeners {
|
||||||
child.Close()
|
child.Close()
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -9,3 +9,5 @@ require (
|
||||||
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 // indirect
|
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 // indirect
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
go 1.13
|
||||||
|
|
Reference in New Issue