Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FrameConn ¶
type FrameConn interface { FrameSize() int //Gracefully stop the FrameConn Close() error // SendFrame sends a bounded-size frame over the connection. // PRE: b :->[] bs, len(bs) = FrameSize // RET: b :->[] xs, len(xs) = FrameSize // EFF: if err = nil then SendFrame(bs) else (SendFrame(xs) OR NoEffects) SendFrame(b []byte) error // only frames of valid size or less // RecvFrame receives a bounded-size fram over the connection // PRE: b :->[] mm, len(mm) = FrameSize. // RET: b :->[] bs, len(bs) = FrameSize // EFF: if err = nil then RecvFrame(bs) else (RecvFrame(bs) OR NoEffects) RecvFrame(b []byte) (err error) }
func FromOrderedStream ¶
FromOrderedStream wraps a net.Conn in a framing layer. PRE: c :-> net.Conn RET: ret :-> FrameConn{FrameSize = frameSize}
type RoundRobin ¶
type RoundRobin struct {
// contains filtered or unexported fields
}
func NewRoundRobin ¶
func NewRoundRobin(frameSize int) *RoundRobin
func (*RoundRobin) AddConn ¶
func (rr *RoundRobin) AddConn(fc FrameConn)
func (*RoundRobin) Close ¶
func (rr *RoundRobin) Close() error
TODO: Make it so that this can be called more than once freely
func (*RoundRobin) FrameSize ¶
func (rr *RoundRobin) FrameSize() int
FrameSize implements FrameConn.FrameSize
func (*RoundRobin) RecvFrame ¶
func (rr *RoundRobin) RecvFrame(b []byte) error
RecvFrame implements FrameConn.RecvFrame It pulls the next frame out of the recv channel This method should be running continously to prevent blocking on the recv chan
func (*RoundRobin) RemoveConn ¶
func (rr *RoundRobin) RemoveConn(fc FrameConn)
TODO: Implement this more efficiently
func (*RoundRobin) SendFrame ¶
func (rr *RoundRobin) SendFrame(b []byte) error
SendFrame implements FrameConn.SendFrame
Click to show internal directories.
Click to hide internal directories.