backend

package
v0.0.0-...-474e83c Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package backend provides various socket implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnNewSocketConnection

func OnNewSocketConnection(f func(BackendSocket))

OnNewSocketConnection sets the event function which is triggered if a new socket connection was made.

Types

type BackendSocket

type BackendSocket interface {
	Type() SocketType
	RemoteAddr() string
	UserAgent() string

	Close()
	IsClosed() bool
	OnClose(OnCloseFunc)

	WriteChan() chan string
	ReadChan() chan string
}

type OnCloseFunc

type OnCloseFunc func()

type SocketType

type SocketType int
const (
	// The available socket types.
	TypeAjaxSocket SocketType = 1 << iota
	TypeWebSocket  SocketType = 1 << iota
)

Directories

Path Synopsis
Emit a close function only once, also if called multiple times.
Emit a close function only once, also if called multiple times.

Jump to

Keyboard shortcuts

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