net

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandler

type AuthHandler func(server string, msg *comet.AuthMsg) (ReaderWriterCloser, error)

type Group

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

func NewGroup

func NewGroup(appId, uid, addr string) *Group

func (*Group) JoinIn

func (g *Group) JoinIn(gids []string) error

func (*Group) JoinInByKey

func (g *Group) JoinInByKey(key string, gids []string) error

type IMConn

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

func DialIM

func DialIM(server string, authMsg *comet.AuthMsg, hb time.Duration, auth AuthHandler) (*IMConn, error)

func DialIMAndServe

func DialIMAndServe(server string, authMsg *comet.AuthMsg, hb time.Duration, auth AuthHandler) (*IMConn, error)

func (*IMConn) Close

func (c *IMConn) Close()

Close the channel.

func (*IMConn) GetConnId

func (c *IMConn) GetConnId() string

func (*IMConn) Push

func (c *IMConn) Push(p *comet.Proto) (seq int32, err error)

Push server push message.

func (*IMConn) RePush

func (c *IMConn) RePush(p *comet.Proto) (seq int32, err error)

RePush server resend message.

func (*IMConn) Read

func (c *IMConn) Read() *comet.Proto

func (*IMConn) Signal

func (c *IMConn) Signal()

Signal send wb to the channel, protocol ready.

type ReaderWriterCloser

type ReaderWriterCloser interface {
	WriteProto(proto *comet.Proto) (err error)
	ReadProto(proto *comet.Proto) (err error)
	SetReadDeadline(t time.Time) error
	Close() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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