conn

package
v0.0.0-...-522126a Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package conn is an RPC connection to a syscall RPC server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCConnection

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

RPCConnection represents a single RPC connection to a syscall gofer.

func NewRPCConnection

func NewRPCConnection(s *unet.Socket) *RPCConnection

NewRPCConnection initializes a RPC connection to a socket gofer.

func (*RPCConnection) NewRequest

func (c *RPCConnection) NewRequest(req pb.SyscallRequest, ignoreResult bool) (uint64, chan struct{})

NewRequest makes a request to the RPC gofer and returns the request ID and a channel which will be closed once the request completes.

func (*RPCConnection) RPCReadFile

func (c *RPCConnection) RPCReadFile(path string) ([]byte, *syserr.Error)

RPCReadFile will execute the ReadFile helper RPC method which avoids the common pattern of open(2), read(2), close(2) by doing all three operations as a single RPC. It will read the entire file or return EFBIG if the file was too large.

func (*RPCConnection) RPCWriteFile

func (c *RPCConnection) RPCWriteFile(path string, data []byte) (int64, *syserr.Error)

RPCWriteFile will execute the WriteFile helper RPC method which avoids the common pattern of open(2), write(2), write(2), close(2) by doing all operations as a single RPC.

func (*RPCConnection) Request

func (c *RPCConnection) Request(id uint64) pb.SyscallResponse

Request retrieves the request corresponding to the given request ID.

The channel returned by NewRequest must have been closed before Request can be called. This will happen automatically, do not manually close the channel.

Jump to

Keyboard shortcuts

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