ptextras

package
v0.0.0-...-796008b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2016 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package ptextras implements extra goodies useful for writing Tor Pluggable Transports that are not included in goptlib as of verson 0.0.6.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsClient

func IsClient() (bool, error)

IsClient returns true if the executable is running as a PT client, false if running as a server, and an error if it is not being run as a managed transport.

Types

type TermMonitor

type TermMonitor struct {
	// contains filtered or unexported fields
}

TermMonitor is a signal/termination monitor used to handle the shutdown management for Tor Pluggable Transports.

func NewTermMonitor

func NewTermMonitor() (m *TermMonitor)

NewTermMonitor creates a new termination monitor instance.

func (*TermMonitor) OnHandlerFinish

func (m *TermMonitor) OnHandlerFinish()

OnHandlerFinish is the routine that should be called when a handler finishes.

func (*TermMonitor) OnHandlerStart

func (m *TermMonitor) OnHandlerStart()

OnHandlerStart is the routine that should be called when a handler starts.

func (*TermMonitor) Wait

func (m *TermMonitor) Wait(termOnNoHandlers bool) os.Signal

Wait blocks until a signal has been received, or (optionally) the number of pending handlers has hit 0. In the case of the latter, it is treated as if a SIGTERM has been received.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL