comm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionManager

type ConnectionManager interface {
	SendStream(data *pb.StreamMessage, successCallBack OnSuccess, errorCallBack OnError, connectionID string)

	Stop()

	Close(connectionID string)

	CreateStreamClientConn(connectionID string, ip string) error

	Size() int

	//Server on function
	Stream(stream pb.StreamService_StreamServer) error

	SetOnConnectHandler(onConnectionHandler OnConnectionHandler)

	Subscribe(name string, subfunc func(message msg.OutterMessage))
}

comm은 peer 들간의 connection을 유지하고있다. comm을 통해 peer들과 통신한다.

func NewConnectionManagerImpl

func NewConnectionManagerImpl(crpyto auth.Crypto) ConnectionManager

type ConnectionManagerImpl

type ConnectionManagerImpl struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Connection관리와 message-> Envelop검사를 수행한다.

func (*ConnectionManagerImpl) Close

func (comm *ConnectionManagerImpl) Close(connectionID string)

func (*ConnectionManagerImpl) CreateStreamClientConn

func (comm *ConnectionManagerImpl) CreateStreamClientConn(connectionID string, ip string) error

func (*ConnectionManagerImpl) SendStream

func (comm *ConnectionManagerImpl) SendStream(message *pb.StreamMessage, successCallBack OnSuccess, errorCallBack OnError, connectionID string)

todo close 어떻게 할지

func (*ConnectionManagerImpl) SetOnConnectHandler

func (comm *ConnectionManagerImpl) SetOnConnectHandler(onConnectionHandler OnConnectionHandler)

func (*ConnectionManagerImpl) Size

func (comm *ConnectionManagerImpl) Size() int

func (*ConnectionManagerImpl) Stop

func (comm *ConnectionManagerImpl) Stop()

func (*ConnectionManagerImpl) Stream

func (*ConnectionManagerImpl) Subscribe

func (comm *ConnectionManagerImpl) Subscribe(name string, subfunc func(message msg.OutterMessage))

type OnConnectionHandler

type OnConnectionHandler func(conn conn.Connection, peer pb.Peer)

type OnError

type OnError func(error)

type OnSuccess

type OnSuccess func(interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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