listener

package
v0.0.0-...-b2761b6 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2014 License: GPL-3.0, GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package listener has code to listen for device connections and setup sessions for them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceListener

type DeviceListener struct {
	net.Listener
}

DeviceListener listens and setup sessions from device connections.

func DeviceListen

func DeviceListen(cfg DeviceListenerConfig) (*DeviceListener, error)

DeviceListen creates a DeviceListener for device connections based on config.

func (*DeviceListener) AcceptLoop

func (dl *DeviceListener) AcceptLoop(session func(net.Conn) error, logger logger.Logger) error

AcceptLoop accepts connections and starts sessions for them.

type DeviceListenerConfig

type DeviceListenerConfig interface {
	// Addr to listen on.
	Addr() string
	// TLS key
	KeyPEMBlock() []byte
	// TLS cert
	CertPEMBlock() []byte
}

A DeviceListenerConfig offers the DeviceListener configuration.

Jump to

Keyboard shortcuts

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