Documentation
¶
Index ¶
- Constants
- Variables
- func NewTimerChan(d int64) <-chan byte
- func Now() int64
- func NowNS() int64
- func StartWatch(s string) *watch
- type Conn
- func (c *Conn) Close() (err error)
- func (c *Conn) IsClosed() bool
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) PrintState()
- func (c *Conn) Read(buf []byte) (nr int, err error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(data []byte) (nr int, err error)
- type Endpoint
- type Params
- type TimeoutError
Constants ¶
View Source
const Millisecond = 1e6
Variables ¶
View Source
var ( ErrIOTimeout error = &TimeoutError{} ErrUnknown = errors.New("Unknown error") ErrInexplicableData = errors.New("Inexplicable data") ErrTooManyAttempts = errors.New("Too many attempts to connect") )
Functions ¶
func NewTimerChan ¶
func StartWatch ¶
func StartWatch(s string) *watch
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) Close ¶
active close: 1 <- send fin-W: closeW()
before sending, ensure all outQ items has beed sent out and all of them has been acked.
2 -> wait to recv ack{fin-W}
then trigger closeR, including send fin-R and wait to recv ack{fin-R}
passive close: -> fin:
if outQ is not empty then self-spin wait. if outQ empty, send ack{fin-W} then goto closeW().
func (*Conn) PrintState ¶
func (c *Conn) PrintState()
func (*Conn) RemoteAddr ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func NewEndpoint ¶
type TimeoutError ¶
type TimeoutError struct{}
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string
func (*TimeoutError) Temporary ¶
func (e *TimeoutError) Temporary() bool
func (*TimeoutError) Timeout ¶
func (e *TimeoutError) Timeout() bool
Click to show internal directories.
Click to hide internal directories.