udp

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package udp implements a UDP server. It listens on a given port and echos whatever it receives. This is used for the UDP probe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(port int, l *logger.Logger) (*net.UDPConn, error)

Listen opens a UDP socket on the given port. It also attempts to set recv buffer to a large value so that we can have many outstanding UDP messages. Listen is exported only because it's used by udp probe tests.

Types

type Server

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

Server implements a basic UDP server.

func New

func New(initCtx context.Context, c *configpb.ServerConf, l *logger.Logger) (*Server, error)

New returns an UDP server.

func (*Server) Start

func (s *Server) Start(ctx context.Context, dataChan chan<- *metrics.EventMetrics) error

Start starts the UDP server. It returns only when context is canceled.

Directories

Path Synopsis
This binary implements a stand-alone UDP server using the cloudprober/servers/udp/udp package.
This binary implements a stand-alone UDP server using the cloudprober/servers/udp/udp package.

Jump to

Keyboard shortcuts

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