Documentation ¶
Overview ¶
Package conn is an RPC connection to a syscall RPC server.
Index ¶
- type RPCConnection
- func (c *RPCConnection) NewRequest(req pb.SyscallRequest, ignoreResult bool) (uint64, chan struct{})
- func (c *RPCConnection) RPCReadFile(path string) ([]byte, *syserr.Error)
- func (c *RPCConnection) RPCWriteFile(path string, data []byte) (int64, *syserr.Error)
- func (c *RPCConnection) Request(id uint64) pb.SyscallResponse
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 ¶
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.