srpc

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: GPL-2.0, GPL-2.0-or-later Imports: 7 Imported by: 0

Documentation

Overview

Package srpc gives symmetric bi-directional RPC on top of GO rpc. Two hosts connected via are Client and server both expose RPC calls to each other. Either host may make RPC calls to the other: so each host is both client and server at the same time.

Index

Constants

View Source
const (
	IsWrite eventFlag = 1 << iota
	IsClient
	IsData
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConn

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

func (*ClientConn) Close

func (c *ClientConn) Close() error

func (*ClientConn) Read

func (c *ClientConn) Read(p []byte) (n int, err error)

func (*ClientConn) Write

func (c *ClientConn) Write(b []byte) (n int, err error)

type Server

type Server struct {
	*rpc.Client
	*rpc.Server
	EventTag string
	// contains filtered or unexported fields
}

func (*Server) Init

func (r *Server) Init(rwc io.ReadWriteCloser, regs ...interface{})

func (*Server) InitWriter

func (r *Server) InitWriter(wc io.WriteCloser, recycle chan elib.ByteVec, regs ...interface{})

func (*Server) Input

func (r *Server) Input(b []byte) (n int)

func (*Server) Serve

func (r *Server) Serve() error

type ServerConn

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

func (*ServerConn) Close

func (c *ServerConn) Close() error

func (*ServerConn) Read

func (c *ServerConn) Read(p []byte) (n int, err error)

func (*ServerConn) Write

func (c *ServerConn) Write(b []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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