server

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package server implements the DASH server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// Datadir is the directory where to save measurements
	Datadir string

	// Logger is the logger to use. This field is initialized by the
	// NewHandler constructor to a do-nothing logger.
	Logger model.Logger
	// contains filtered or unexported fields
}

Handler is the DASH handler

func NewHandler

func NewHandler(datadir string) (handler *Handler)

NewHandler creates a new handler instance

func (*Handler) CountSessions

func (h *Handler) CountSessions() (count int)

CountSessions return the number of active sessions

func (*Handler) JoinReaper

func (h *Handler) JoinReaper()

JoinReaper blocks until the reaper has terminated

func (*Handler) RegisterHandlers

func (h *Handler) RegisterHandlers(mux *http.ServeMux)

RegisterHandlers registers handlers for the URLs used by the DASH experiment. The following prefixes are registered:

- /negotiate/dash - /dash/download - /collect/dash

The /negotiate/dash prefix is used to create a measurement context for a dash client. The /download/dash prefix is used by clients to request data segments. The /collect/dash prefix is used to submit client measurements.

func (*Handler) StartReaper

func (h *Handler) StartReaper(ctx context.Context)

StartReaper starts the reaper goroutine that makes sure that we write back results of incomplete measurements. This goroutine will terminate when the |ctx| context becomes expired.

Jump to

Keyboard shortcuts

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