Documentation ¶
Overview ¶
Package ipc handles inter-process communication using UDP. It limits communication to 127.0.0.1 and does not handle packet order or dropped packets because these are unlikely issues locally.
Index ¶
- Variables
- type Package
- type Proc
- func (p *Proc) Close() error
- func (p *Proc) GetPort() rnet.Port
- func (p *Proc) Handler(handler func(*Package))
- func (p *Proc) IsOpen() bool
- func (p *Proc) IsRunning() bool
- func (p *Proc) Run()
- func (p *Proc) Send(id uint32, msg []byte, port rnet.Port)
- func (p *Proc) Stop() error
- func (p *Proc) String() string
Constants ¶
This section is empty.
Variables ¶
var PacketSize = 50000
PacketSize is the max packet size, it's set a bit less than the absolute max at a nice, round value.
Functions ¶
This section is empty.
Types ¶
type Package ¶
type Package struct { ID uint32 Body []byte Addr *rnet.Addr Len int // contains filtered or unexported fields }
Package is used to assemble the messages and send them through the channel when they are complete.
type Proc ¶
type Proc struct {
// contains filtered or unexported fields
}
Proc represents a process that can send and receive communication from other local Procs over UDP.
func New ¶
New returns a Proc for sending and receiving communications with other local processes. The server will not be running initially.
func RunNew ¶
RunNew returns a Proc for sending and receiving communications with other local processes. The server will be running initially.
func (*Proc) IsOpen ¶
IsOpen returns true if the connection is open. If the server is closed, it can neither send nor receive
func (*Proc) Run ¶
func (p *Proc) Run()
Run will start the listen loop. Calling run multiple times will not start multiple listen loop.