You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.5 KiB

package connectivity
import (
const acnError = "error initializing anonymous communication network"
// ErrorACN - a status-callback safe errored ACN. Use this when ACN construction goes wrong
// and you need a safe substitute that can later be replaced with a working ACN without impacting calling clients.
type ErrorACN struct {
statusCallbackCache func(int, string)
versionCallbackCache func(string)
func (e ErrorACN) GetStatusCallback() func(int, string) {
return e.statusCallbackCache
func (e ErrorACN) GetVersionCallback() func(string) {
return e.versionCallbackCache
func (e *ErrorACN) GetInfo(addr string) (map[string]string, error) {
return nil, errors.New(acnError)
func (e ErrorACN) GetBootstrapStatus() (int, string) {
return -1, acnError
func (e ErrorACN) WaitTillBootstrapped() error {
return errors.New(acnError)
func (e *ErrorACN) SetStatusCallback(callback func(int, string)) {
e.statusCallbackCache = callback
func (e *ErrorACN) SetVersionCallback(callback func(string)) {
e.versionCallbackCache = callback
func (e ErrorACN) Restart() {
func (e ErrorACN) Open(hostname string) (net.Conn, string, error) {
return nil, "", fmt.Errorf(acnError)
func (e ErrorACN) Listen(identity PrivateKey, port int) (ListenService, error) {
return nil, fmt.Errorf(acnError)
func (e ErrorACN) GetPID() (int, error) {
return -1, fmt.Errorf(acnError)
func (e ErrorACN) GetVersion() string {
return acnError
func (e ErrorACN) Close() {